Double click

What is the event get trigger when i double clik on the row in grid. I would like to trigger a event and get the selected value on the server.

As always thx a lot for your help ...


2 Replies

RP Rekha P Syncfusion Team January 12, 2009 08:38 AM UTC

Hi Prasanna,

Thank you for your interest in Syncfusion Products.

The event which will trigger for a record click on server side is SelectedRecordsChanged event. The properties PostBackOnFocusedChanged and PostBackOnRowDblClick has to be set to true, to handle this event.

Please refer the below code snippet which is used to get the selected record through the "SelectedRecordsChanged" event.

[C#]

protected void GridGroupingControl1_SelectedRecordsChanged(object sender, Syncfusion.Grouping.SelectedRecordsChangedEventArgs e)
{
Record r = this.GridGroupingControl1.Table.CurrentRecord;

if (ViewState["currentrecord"] == null)
{
ViewState["currentrecord"] = r.GetValue("ID").ToString();
}
else if (r != null && r.IsCurrent)
{

if (ViewState["currentrecord"].ToString() != r.GetValue("ID").ToString())
{
Record currentrec = r;
this.TextBox1.Text = currentrec.GetValue("Name").ToString();
}
}
}


Also please refer the sample from the below link, which ilustrates the above:

http://websamples.syncfusion.com/samples/Grid.Web/6.4.0.15/F78916_GetSelectedValue/main.htm

Please let me know if this sample helps you.

Thanks,
Rekha



PR prasanna January 13, 2009 02:33 AM UTC

Hi,

Thx for quick response.

What you have sent is single click. But i need is Double Click.

Please let me know if double click is supported in Sync fusion grid.

Regards,
Prasanna


>Hi Prasanna,

Thank you for your interest in Syncfusion Products.

The event which will trigger for a record click on server side is SelectedRecordsChanged event. The properties PostBackOnFocusedChanged and PostBackOnRowDblClick has to be set to true, to handle this event.

Please refer the below code snippet which is used to get the selected record through the "SelectedRecordsChanged" event.

[C#]

protected void GridGroupingControl1_SelectedRecordsChanged(object sender, Syncfusion.Grouping.SelectedRecordsChangedEventArgs e)
{
Record r = this.GridGroupingControl1.Table.CurrentRecord;

if (ViewState["currentrecord"] == null)
{
ViewState["currentrecord"] = r.GetValue("ID").ToString();
}
else if (r != null && r.IsCurrent)
{

if (ViewState["currentrecord"].ToString() != r.GetValue("ID").ToString())
{
Record currentrec = r;
this.TextBox1.Text = currentrec.GetValue("Name").ToString();
}
}
}


Also please refer the sample from the below link, which ilustrates the above:

http://websamples.syncfusion.com/samples/Grid.Web/6.4.0.15/F78916_GetSelectedValue/main.htm

Please let me know if this sample helps you.

Thanks,
Rekha




Loader.
Up arrow icon