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

Double click evevnt in Grid grouping control

Hi,

I want to use the values of current record on which user double clicks. Please let me know what code i should write for the same . we are using syncfusion 6.3.0.6.

Thanks,
Kallyani


5 Replies

RS Rajarajeswari S Syncfusion Team July 17, 2008 05:17 AM UTC

Hi Kallyani,

Thanks for using Syncfusion products.

Double clicking on the records will leads to Edit mode in GridGroupingControl.But your requirement can be achieved with Single click through client side event called "ClientSideOnRecordClick".

Please refer the below code snippet which illustartes this:

function select(gridObj)
{
document.getElementById('TextBox1').innerText = gridObj.Row.GetValue('id');
}


Please refer the sample from the below link which illustartes this:

http://www.syncfusion.com/support/user/uploads/RecordValue_e503661f.zip

Please let me know if you have any other concerns.

Regards,
Raji



KL Kallyani Lanje August 1, 2008 08:08 AM UTC

i want to use doubleclick functionality on ggc cell to bind data from clicked ggc cell to textbox. lemme know the server side code for the same.



RS Rajarajeswari S Syncfusion Team August 6, 2008 05:17 PM UTC

Hi Kallyani,

Thanks for using Syncfusion products.

On server side we are having “SelectedRecordsChanged” event, which will get raised for a record click. Please refer the below code snippet which is used to get the selected record through the “SelectedRecordsChanged” event:


protected void GridGroupingControl1_RecordsChanged(object sender, Syncfusion.Grouping.SelectedRecordsChangedEventArgs e)
{

Record r = this.GridGroupingControl1.Table.CurrentRecord;
if(r != null)
this.TextBox1.Text = r.GetValue("id").ToString();

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("id").ToString();
}
}

}

As I mentioned in my previous post, doubleclick of a record or cell leads to Editmode. The above code works for a single click.

Please refer the sample from the below link, which illustrates the above:

http://www.syncfusion.com/support/user/uploads/Sample_6821c861.zip

Please try the above and let us know if this helps you out.

Regards,
Raji




DJ Deepika Jain December 29, 2011 04:25 PM UTC

Please post the sample code once again as the link that you posted doesn't seem to be working. I want to show an alert on double click og any of th erow in grid data control and this alert should show the values of the different columns in the clicked row. for example: my row contains employee name, id and their marks so on double click of this row, I want to get the individual values of this in some variables.



YO Yogeshwaran Syncfusion Team January 5, 2012 09:11 AM UTC

Hi Deepika,

Thanks for using Syncfusion products.

Your requirement to get record value of currently double clicked row can be achieved by using client side event “ClientSideOnRowDoubleClick” .please refer the following code snippet.
[Jquery]

function Select(Gridobj) {

Temp = {};
$.each(Gridobj.Row.gridTable.visibleColumns, function (index, value) {
//index 0 is indent row . to avoid this we have to check condition
if(index !=0)
Temp[index] = Gridobj.Row.GetValue(value.name);
});

}



For your convenience, we have created the sample and the same can be downloaded from the below link.

ColumnWidth-GridWeb-136404553.zip

Please let us know if you have any concerns.

Regards,
Yogesh R


Loader.
Live Chat Icon For mobile
Up arrow icon