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.

Event to use when user clicks on an item in Gridlist control

Thread ID:

Created:

Updated:

Platform:

Replies:

69768 Nov 12,2007 05:18 AM Nov 13,2007 08:12 AM Windows Forms 2
loading
Tags: GridControl
Arun
Asked On November 12, 2007 05:18 AM

Hi
I have a requirement, wherein if the user clicks or selects an item in grid list control, the item is added in another grid control. I used SelectedValueChanged() event, but this also gets fired initially when data is bound to grid control.
Next i tried using Click() event. This works fine, but if user click anywhere (any free space) on grid control the selected value(if any) is added.
I want the item to be added only when a user clicks on a particular item.
Please find the attached sample application.




GridListTest.zip

Jisha Joy [Syncfusion]
Replied On November 12, 2007 08:28 AM

Hi Arun,

Thank you for posting query to us.

The mentioned behavior can be achieved by handling the Grid.CellClick event of GridListControl.
Here is the code snippets:

this.glcSample.Grid.CellClick += new GridCellClickEventHandler(Grid_CellClick);

void Grid_CellClick(object sender, GridCellClickEventArgs e)
{
clsData objDat = (clsData)glcSample.Items[e.RowIndex-1];
Add(objDat);

}

Please refer the modified sample in the link to illustrate this:
http://websamples.syncfusion.com/samples/Grid.Windows/69768/main.htm

Please try this and let me know if this helps.

Regards,
Jisha



Arun
Replied On November 13, 2007 08:12 AM

Hi Jisha
Thank you. It worked fine.

Regards
Arun


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.

;