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

Select full row in GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

78490 Dec 16,2008 07:04 AM UTC Dec 17,2008 01:31 PM UTC Windows Forms 6
loading
Tags: GridControl
champak chaini
Asked On December 16, 2008 07:04 AM UTC

Hi,

How to select a full row in gridDataBoundGrid.
When you click on the cell also, the cell style should be similar to the other cell of the selected row.

Also how to change the Font of the selected Row.


Rajadurai C [Syncfusion]
Replied On December 16, 2008 11:06 AM UTC

Hi Champak,

Thanks for your interest in Syncfusion products.

1) You can select a full row by means of ListBoxSelectionMode property.

this.gridDataBoundGrid1.ListBoxSelectionMode = SelectionMode.One;


2) The cellstyle(font and style while editing) of a cell can be maintained as with other cells in the row selected with the ListBoxSelectionMode through the following event handler.

//event handler
this.gridDataBoundGrid1.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(gridDataBoundGrid1_PrepareViewStyleInfo);

void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if (e.RowIndex == cc.RowIndex)
{
e.Style.Font.Italic = true;
e.Style.BackColor = SystemColors.Highlight;
}
}


Regards,
Rajadurai


champak chaini
Replied On December 16, 2008 01:35 PM UTC

I had set the SelectListBox property to One, and the whole row is selected but still when you click on a cell the cell is displayed as a text box and highlighted as cell, but other column of the selected row has same style.


Rajadurai C [Syncfusion]
Replied On December 16, 2008 02:45 PM UTC

Hi Champak,

Thanks for your update.

Please refer the following sample in which i reproduced this issue.

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

I couldn't understand what you are insisting as style in other cells in that selectedrow.

If possible, please reproduce the behavior you are insisting in this sample or a screenshot showing the behavior and send us so that we could find a fix for it.

Regards,
Rajadurai


champak chaini
Replied On December 17, 2008 12:34 PM UTC

Hi Rajadurai,

I have attached one sample. See the grid on the top, the whole row is selected, but since i clicked on the first column cell, the "Address Register Type" is shown differently than the second column and row header for the selected row.

I want something like the grid below, where ever you click on the same row, the style should be same. Also the selected row font should be bold.

Regards,
champak
>Hi Champak,

Thanks for your update.

Please refer the following sample in which i reproduced this issue.

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

I couldn't understand what you are insisting as style in other cells in that selectedrow.

If possible, please reproduce the behavior you are insisting in this sample or a screenshot showing the behavior and send us so that we could find a fix for it.

Regards,
Rajadurai





SyncfusionIssue_308507e.zip

Rajadurai C [Syncfusion]
Replied On December 17, 2008 01:27 PM UTC

Hi Champak,

Thanks for your update.

I had gone through the screenshot sent.The sample sent by us in the last update solves this issue.For your reference, i'm attaching here a screenshot of the sample.
http://www.syncfusion.com/support/user/uploads/F78490a_2df8ddee.zip

Please let me know if you have any further concerns.

Regards,
Rajadurai


Rajadurai C [Syncfusion]
Replied On December 17, 2008 01:31 PM UTC

Hi Champak,

To make the currentrow text to appear bold, please try the following code:

void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if (e.RowIndex == cc.RowIndex)
{
e.Style.Font.Bold = true;
e.Style.BackColor = SystemColors.Highlight;
}
}


Regards,
Rajadurai


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

;