User Profile & Activity

Handy Surya Support
Page
of 223
Posted: September 27, 2011 3:06 AM

Hello Eric,

Yes, you were correct. Instead by using HiddenField, you can also use SendCustomRequest() and AddInput() via script to send data to server. You can access it the data in InitializePostBack server side event.
Actually, it would be too much effort if you disable the cache. In WebGrid 7, it has new feature called Batch Update. All the changes would not be saved until we accept all the changes. Event though we already used accept changes, we still can interrupt it in OnBatchUpdate server side event.
All the changes in cells can be seen in changes collection. This feature can work well without caches.

Regards,
Handy

Posted: September 27, 2011 2:45 AM

Hello,

You would need also to use  <FlyPostBackSettings PostInputControls="True" />. This should fix the issue.

Regards,
Handy

Hello,

It seems based on your WebGrid, table is not the correct element. It easier to get it directly from WebGrid element. You can try to find the proper location that you want to place the text for sum of items.

e.g grid.GetElement(WG40.STATUSBAR, WG40.HTMLCELL);
This code will let you get the element of "Ready" in status bar. You may able to go to its parentNode or perhaps add new <td> to easier to mantain layout information for your status bar. Hope this helps.

Regards,
Handy

Hello,

I think it is not because our WebTreeView, but closely to iframe issue. Since you are not using our control in loading IFrame, then something must be wrong with the code that load iframe content. If you seen my sample, I used WebPaneManager. It can load iframe content correctly in there.
So, I don't think if this is an issue in our WebTreeView, since your load iframe code is not came from us.

Regards,
Handy

Posted: September 26, 2011 4:55 AM

Hello Eric,

I could not modify your sample because I don't know much about what kind of save or code that you wanted to call.

if(Sum==10.0) 
{
			//do save here
			//How do we get the data in the grid???
} 
else 
{
			//cannot save, Sum must be 10.
}

So, basically how to save data is something that you need to take care of. I can only show how to get data in grid.

E.g I added a hidden field to your sample, named sum. 

function Table_ExitEditMode(controlId, tblName, editObject) 
{
	var cell = editObject.cellElement;
	var inp = editObject.element;
	var col = wgGetColumnByElement(cell);
	var row = wgGetRowByElement(cell);
	var sum = document.getElementById("HiddenField1");
	switch (col.Name) {
		case 'Weight':
			if (IsValidPercentage(inp.value)) {
				var grid = ISGetObject(controlId);
				var grandTotal = 0;
				for (var i = 0; i < grid.TotalRows; i++) {
					// Note: The unary '+' is to convert the string into a number.
					if (i == row.Position)
						grandTotal += +inp.value;
					else
						grandTotal += +grid.RootTable.GetRow(i).GetCells()[col.Position].Value;
				}
				// column footer
				var NumInvisibleColumns = GetNumInvisibleColumns(grid);
				grid.RootTable.GetElement(WG40.COLFOOTER, WG40.HTMLTABLE).rows[1].cells[col.Position - NumInvisibleColumns+1].innerText = grandTotal.toFixed(2);
			} else {
				// not a valid percentage
				alert('\'' + inp.value + '\' is not a valid percentage!');
				inp.value = cell.OldText;
				
			}
			break;
	}
	sum.value = grandTotal;
return true; }

 
After you use PostInputControls to true, you should be able get the data in postback/server.
In your idButton_OnClick, you should able to access the value by using hidden field id.

Regards,
Handy




Posted: September 26, 2011 4:43 AM

Hello Richard,

Can you send me your simple runable project that replicates this issue? And what kind of data that you would like to pass?

Regards,
Handy

Hello Michael,

Allow me to help you answer the question one by one.

1. Silverlight class library
Today I've worked with ClientUI MVVM Data Application template. The structure of the generic base classes is great! The only downer is that partly text messages (e.g. MessagePresenter) are hard coded!

Unfortunately it is not possible (I did not manage) to move the dictionaries ModelServices.Infrastructure andViewModels.Infrastructure in a Silverlight class library. In the Silverlight Class Library, I can not reference the assemblyIntersoft.Client.Data.ComponentModel. Is there another way to increase the reusability?

Is probably a mistake in MessagePresenter.cs:

public void AskYesOrNo(string question, Action yesAction, Action noAction)
{
    MessageBoxServiceProvider.Show(
        "Are you sure you want to delete the selected contact?",
        "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question,
        dialogResult =>
        {
            if (dialogResult == DialogResult.Yes)
            {
                if (yesAction != null)
                    yesAction();
            }
            else
            {
                if (noAction != null)
                    noAction();
            }
        });
}

better is:

MessageBoxServiceProvider.Show(question,"Confirmation"MessageBoxButton.YesNo,MessageBoxImage.Question,


Thank you for the feedback. Of course, you can use that way. If you check our MessageBoxServiceProvider classes, we provided show() methods with several parameters option that you can choose. 


2. Gouping
The products page is grouped by CategoryID. If I delete the following code ...

<Intersoft:UXGridView.GroupDescriptors>

<Intersoft:UXGridViewGroupDescriptor PropertyName="CategoryID"/>

</Intersoft:UXGridView.GroupDescriptors>

... then I get the error message: The method 'OrderBy' must be called before the method 'Skip'. So I inserted the following code...

<Intersoft:UXGridView.SortDescriptions>

<ComponentModel:SortDescription PropertyName="RegionID" Direction="Ascending"/>

</Intersoft:UXGridView.SortDescriptions>

...I still get the same error message. Order by is still missing in URL: 
http://localhost:20316/ClientBin/ClientUIDataAppWithPic-Web-NorthwindDomainService.svc/binary/GetRegions?$skip=0&$take=20&$includeTotalCount=True

It works, if I add the SortDescriptor in constructor. If this is the only way?

public RegionsViewModel() :

base()

{

this.QueryDescriptor.SortDescriptors.Add(new SortDescriptor() { PropertyName = "RegionID", Direction = ListSortDirection.Descending });

}

The products page is grouped by CategoryID. If I delete the following code ...

<Intersoft:UXGridView.GroupDescriptors>

<Intersoft:UXGridViewGroupDescriptor PropertyName="CategoryID"/>

</Intersoft:UXGridView.GroupDescriptors>

... then I get the error message: The method 'OrderBy' must be called before the method 'Skip'. So I inserted the following code...

<Intersoft:UXGridView.SortDescriptions>

<ComponentModel:SortDescription PropertyName="RegionID" Direction="Ascending"/>

</Intersoft:UXGridView.SortDescriptions>

...I still get the same error message. Order by is still missing in URL: 
http://localhost:20316/ClientBin/ClientUIDataAppWithPic-Web-NorthwindDomainService.svc/binary/GetRegions?$skip=0&$take=20&$includeTotalCount=True

It works, if I add the SortDescriptor in constructor. If this is the only way?

public RegionsViewModel() :

base()

{

this.QueryDescriptor.SortDescriptors.Add(new SortDescriptor() { PropertyName = "RegionID", Direction = ListSortDirection.Descending });

}

If  I am not mistaken, grouping behavior should do grouping with sorting ascending as default. So, basically, it needs to run along with sorting. That's why you got error if you did not specify any sort descriptor in grouping.


 3. Copy/Paste
Using the context menu, I can copy rows in UXGridView. How can I paste the copied row again?
We do have this property in our UXGridView. However, we do not provide paste option in context menu. UXGridView area is not designed to be pasted. The format can be different. For now, it can only be pasted into textbox.

Regards,
Handy

Posted: September 26, 2011 3:52 AM

Hello,

Can you show me how you do the current scenario? Please send me a simple runable sample that replicates this issue. I need to see know more details about this.

Regards,
Handy

Posted: September 26, 2011 3:25 AM

Hello,

Our developer tried hard to make it better. Please try to use attached hotfix. Also, it seems, it needs to call twice SetHeight() method.

Regards,
Handy

Hello,

Are you sure? I can change the default text "Group By Box". I also attached how this to be done.

Regards,
Handy

All times are GMT -5. The time now is 2:30 AM.
Previous Next