We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

UnboundField Sort and group

Thread ID:

Created:

Updated:

Platform:

Replies:

32043 Jul 20,2005 01:19 PM Jul 21,2005 12:04 AM Windows Forms 3
loading
Tags: Grouping
Administrator [Syncfusion]
Asked On July 20, 2005 01:19 PM

below code is in TableDescriptor_QueryValue method, "YTD" is a unboundfield, "YTDtmp" is a boundcolumn, when I sort or group by "YTD" column, there is no data in gridGroupingControl,why, can u give me a solution to resolve it? ------------------- int row = e.Record.ParentChildTable.Records.IndexOf(e.Record); if (e.Field.Name == "YTD" ) { GridRecord rec = e.Record.ParentChildTable.Records[row] as GridRecord; if((int)rec.GetValue("ValType")==3) { GridRecord rec1 = e.Record.ParentChildTable.Records[row-1] as GridRecord; GridRecord rec2 = e.Record.ParentChildTable.Records[row-2] as GridRecord; if (Double.Parse(rec2.GetValue("YTDtmp").ToString())>0) { e.Value = Double.Parse( rec1.GetValue("YTDtmp").ToString()) / Double.Parse(rec2.GetValue("YTDtmp").ToString()); } } }

Administrator [Syncfusion]
Replied On July 20, 2005 02:46 PM

If you do not sort or group, do all the values appear as you expect? When you say there is no data in teh grid, do you mean all cells are empty or only the unbound column? What version are you using? Do you see any exceptions being listed in your output window? When you step through this event, is the if statement ever true? What value do you want to see in the unbound column when the if statement is not true? Here is a little sample that seems to work OK. http://www.syncfusion.com/Support/user/uploads/GGC_Unbound_e66bac30.zip

Administrator [Syncfusion]
Replied On July 20, 2005 11:08 PM

When i using you demo(I have modified it to 2.0.5.1),there is no data in unbound field,My version is 2.0.5.1: if i do not sort or group,everything is ok,if group using other boundcolumn,have System.ArgumentOutOfRangeException at this row: GridRecord rec = e.Record.ParentChildTable.Records[row] as GridRecord;(in QueryValue method) if i sort or group using unboundfield,i can just see columnheader without any exceptions out,and groupingcontrol is unusable. //i have a boundcolumn "YTDtemp", //a unboundfield "YTD", //e.g: //ValType YTDtemp YTD //1 10 10 //2 5 5 //3 3 5/10 //when ValType=1 or 2:YTD=YTDtemp //when ValType=3:YTD=YTDtemp(ValType=2)/YTDtemp(ValType=1)/ below is my code: private void TableDescriptor_QueryValue(object sender, FieldValueEventArgs e) { int row = e.Record.ParentChildTable.Records.IndexOf(e.Record); if (e.Field.Name == "YTD" ) { GridRecord rec = e.Record.ParentChildTable.Records[row] as GridRecord; if((int)rec.GetValue("ValType")==3) { GridRecord rec1 = e.Record.ParentChildTable.Records[row-1] as GridRecord; GridRecord rec2 = e.Record.ParentChildTable.Records[row-2] as GridRecord; if (Double.Parse(rec2.GetValue("YTDtmp").ToString())>0) { e.Value = Double.Parse( rec1.GetValue("YTDtmp").ToString()) / Double.Parse(rec2.GetValue("YTDtmp").ToString()); } } } } >If you do not sort or group, do all the values appear as you expect? > >When you say there is no data in teh grid, do you mean all cells are empty or only the unbound column? > >What version are you using? > >Do you see any exceptions being listed in your output window? > >When you step through this event, is the if statement ever true? What value do you want to see in the unbound column when the if statement is not true? > >Here is a little sample that seems to work OK. > >http://www.syncfusion.com/Support/user/uploads/GGC_Unbound_e66bac30.zip >

Administrator [Syncfusion]
Replied On July 21, 2005 12:04 AM

hi,Thanks Stefan, I have resolved it, at first,i assign double type value to e.value, now i assign string type value to e.value, i''s ok. Thanks a lot!

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;