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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PopulateValues - Why doesn't this work?

Thread ID:





3266 Mar 11,2003 02:43 PM UTC Mar 11,2003 05:50 PM UTC WinForms 1
Tags: GridControl
Maxim Software Systems
Asked On March 11, 2003 02:43 PM UTC

I'm trying to fill a grid with data on a row by row basis using the PopulateValues method of the grid. However, only the first column gets text put in it, the other columns of each row are left blank. Dim x(4) As String x(0) = "test1" x(1) = "test2" x(2) = "test3" x(3) = "test4" grdTest.PopulateValues(GridRangeInfo.Cells(1, 1, 1, UBound(x)), x) This code leaves only the first column with the text "test1", but the other columns are blank.

Administrator [Syncfusion]
Replied On March 11, 2003 05:50 PM UTC

If you try this code, you would see your data populate column 1. grdTest.PopulateValues(GridRangeInfo.Cells(1, 1, UBound(x), 1), x) The method only populates across a row if there are two indices in the datasource. If there is only a single index in the datasource, it thinks you want to change rows with each new index. But is is straight-forward (and ver quick) to use SetCellInfo to populate across a row by looping through the row and calling SetCellInfo on each item. (This is what PopulateCells does).
'loop through this code
Dim style as GridStyleInfo = New GridStyleInfo()
style.CellValue = X(i)
grdTest.SetCellInfo(row, i, sfstyle, Syncfusion.Styles.StyleModifyType.Override)


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

Live Chat Icon For mobile
Live Chat Icon