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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DataGrid RowHeader Text

Thread ID:





60509 May 7,2007 02:12 PM UTC May 7,2007 08:52 PM UTC WinForms 4
Tags: GridControl
Greg Goodall
Asked On May 7, 2007 02:12 PM UTC

How do you edit the RowHeader Text of a DataGrid programmatically?

Rows default to "1, 2, 3" and so on. I would like to fill those cells other values such as a customer name, for example.

Thanks, Greg

Saravanan A [Syncfusion]
Replied On May 7, 2007 05:06 PM UTC

Hi Greg,

You can achieve this through the GridStyleInfo object of RowHeader Cell.
Here is the code snippet.

GridStyleInfo style = gridControl1[1, 0];
style.CellValue = "Customer Name";

Best Regards,

Greg Goodall
Replied On May 7, 2007 08:02 PM UTC

Thanks for the tip. My final code looks something like this. I actually have a loop to format multiple rows with differing Customer Names, but this gives the concept.

Dim CustomerName as String
Dim style As GridStyleInfo = GridControl1(i, 0)

CustomerName = "Bob Smith"
style.CellValue = BoxNumber
GridControl1.ChangeCells(GridRangeInfo.Cells(i, 0, i, 0), style)

Greg Goodall
Replied On May 7, 2007 08:05 PM UTC

I had an error in my last post. I should read like this

style.CellValue = CustomerName

Saravanan A [Syncfusion]
Replied On May 7, 2007 08:52 PM UTC

Hi Greg,

To set the text to a range of Cells in a grid you can use the GridControl.PopulateValues method. Please refer to the following sample.
Sample: http://websamples.syncfusion.com/samples/Grid.Windows/F60509/main.htm

Best Regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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