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.
Syncfusion Feedback

Selection Marker in Row Header

Thread ID:

Created:

Updated:

Platform:

Replies:

69490 Oct 30,2007 09:51 AM UTC Nov 1,2007 09:29 AM UTC Windows Forms 1
loading
Tags: GridControl
Arif Eqbal
Asked On October 30, 2007 09:51 AM UTC

Hi,
I am working on a gridGroupingControl, I have the Row Headers visible for the Grid. I want to show a marker or text '*' in the Row Header of the Row that is currently selected. To restrict the Users to select only certain rows, I handle the TableControlCellClick event and manually Select the Row. In the same event handler I would like to mark the Row as selected by showing a marker in the row header.

Thanks

Jisha Joy [Syncfusion]
Replied On November 1, 2007 09:29 AM UTC

Hi Arif,

Thank you for posting query to us.

It is possible to show the text in the Row Header of the currently selected rows by handling the events TableControlCellDrawn and TableModel.SelectionChanged of GridGroupingControl.
Here is the code snippets:

void TableModel_SelectionChanged(object sender, GridSelectionChangedEventArgs e)
{
this.gridGroupingControl1.Refresh();
}

void gridGroupingControl1_TableControlCellDrawn(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlDrawCellEventArgs e)
{
GridRangeInfoList list = gridGroupingControl1.TableModel.Selections.Ranges;
foreach (GridRangeInfo range in list)
{
if (e.Inner.RowIndex >= range.Top && e.Inner.RowIndex <= range.Bottom)
{
if (e.Inner.ColIndex == 0)
{
e.Inner.Graphics.DrawString("*", new Font("Aerial", 10), Brushes.Red, e.Inner.Bounds.Location);
e.Inner.Cancel = true;
}

}
}
}


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

Please try this and let me know if this helps.

Regards,
Jisha




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.

Warning Icon 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.Close Icon

;