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. Image for the cookie policy date

Grouping Grid

I am trying to update the value in a text box when a row is selected in a Grid. The new value does not show in the text box. Here is my code:

protected void grdLocations_SelectedRecordsChanged(object sender, SelectedRecordsChangedEventArgs e)
{
// Cancel the previous record edit mode

if (this.grdLocations.Table.CurrentRecord == null)
return;


// Get the currently selected record in the master grid

int id = (int)this.grdLocations.Table.CurrentRecord.GetValue("LocationID");
int order = (int)this.grdLocations.Table.CurrentRecord.GetValue("DisplayOrder");

TextBox1.Text = order.ToString();


}

8 Replies

RA Ramu Syncfusion Team August 11, 2006 06:26 PM UTC

Hi Greg,

If you are working in .Net 2.0 then this might be becasue the grid''s Callback mode is set to true. could you please check if this is the case.

Else the issue you might be encountering should be because you might not have set the “PostBackOnFocusedChanged” property to true for th grid.

Please refer to the following thread

forum
more information.

Please let me know if you have any queries.

Thanks,
Ramu.K


GM Greg Mills August 11, 2006 07:26 PM UTC


PostBackOnFocusedChanged = True;

When I set EnableCallbacks=False;
the Grids event "SelectedRecordsChanged" fires, but the the selected row does not change.

>Hi Greg,

If you are working in .Net 2.0 then this might be becasue the grid''s Callback mode is set to true. could you please check if this is the case.

Else the issue you might be encountering should be because you might not have set the “PostBackOnFocusedChanged” property to true for th grid.

Please refer to the following thread

forum
more information.

Please let me know if you have any queries.

Thanks,
Ramu.K


AD Administrator Syncfusion Team August 11, 2006 10:37 PM UTC

Hi Greg,

The issue you encountered might be due to missing the primary key column for Grid Grouping control.

Setting the primary key column could solve the issue. You can set the primarykey column for grid as follows.

[C#]

GridTableDescriptor mainTD = this.GridGroupingControl1.TableDescriptor;
mainTD.PrimaryKeyColumns.Add("OrderID");

Please refer to “Using GridGroupingControl” topic under (Essential grid-> ASP.NET-> Introducing Essential Grouping Grid for ASP.NET) for documentation to bind the grid.

Please let us know if you still find the issue.

Thanks,
Ramu.K



AD Administrator Syncfusion Team August 11, 2006 11:48 PM UTC

I found the problem. This does not work when you are using Master Pages. I opened a direct-trac incident.

>Hi Greg,

The issue you encountered might be due to missing the primary key column for Grid Grouping control.

Setting the primary key column could solve the issue. You can set the primarykey column for grid as follows.

[C#]

GridTableDescriptor mainTD = this.GridGroupingControl1.TableDescriptor;
mainTD.PrimaryKeyColumns.Add("OrderID");

Please refer to “Using GridGroupingControl” topic under (Essential grid-> ASP.NET-> Introducing Essential Grouping Grid for ASP.NET) for documentation to bind the grid.

Please let us know if you still find the issue.

Thanks,
Ramu.K



GM Greg Mills August 11, 2006 11:51 PM UTC

Here is the incident #27520.

Here is a attachment the shows the problem.

default page works.

default2 page does not work.

WebSite40.zip


AD Administrator Syncfusion Team August 16, 2006 05:59 AM UTC

Hi Greg,

We had some difficulties in updating the forums and DT for past 2 days and My sincere apology for the delay in responding to you.

In general When using our callbackpanel/CallbackMultiplexer control within a UserControl or a MasterPage then
the client object instance name will be scoped by the UserControl/Masterpage''s instance''s id. So you need to change the scripts according to the client instance''s

Here in your sample you have to change the ''BeforeCallbackScript'' property as follows.

this.InboxGrid.BeforeCallbackScript = "if(arg.indexOf(''MOVETO:RR:'')!=-1){this.continueCallback = false;__sfctl00_ContentPlaceHolder1_CallbackMultiplexer1.doCallback(''ctl00$ContentPlaceHolder1$InboxGrid'', arg);}";

Changes are as follows

a) __sfctl00_ContentPlaceHolder1_CallbackMultiplexer1.doCallback// this line is used for triggering the callback. this is becaue of the callbackmultiplexer is inside the ContentplaceHolder

b)Similarly the client object id of the ''InboxGrid'' will be ''ctl00$ContentPlaceHolder1$InboxGrid'' in this sample. Only if this is mentioned in the arguments correctly the callback knows it is triggered for the appropriate control(i.e eventhough there will be a callback to the server the events of the grid will not trigger if the arguments for the docallback method is wrong)

I have also attached the modified cs file of Default2.aspx.cs. please have a look at it.

Modified Sample

please let us know if you face any more difficulties.

Again I apologize for the delay.

Best Regards,
A.Sivakumar


SI Sivakumar Syncfusion Team August 16, 2006 06:03 AM UTC

Hi Greg,

Sorry for the broken link in the above update, please download the modified sample from
here


Best Regards,
A.Sivakumar





AD Administrator Syncfusion Team August 16, 2006 10:12 PM UTC

This is working great.

>Hi Greg,

Sorry for the broken link in the above update, please download the modified sample from
here


Best Regards,
A.Sivakumar




Loader.
Live Chat Icon For mobile
Up arrow icon