Answered by:
Update GridView In Code

Question
-
User1135810773 posted
When I run the following code ...
protected void Page_Load(object sender, EventArgs e) { gvResults.DataSource = CreateData(); gvResults.DataBind(); }
private ArrayList CreateData() { ArrayList ds = new ArrayList(); ds.Add("ASPxGridView and Editors"); ds.Add("ASPxTreeList"); ds.Add("ASPxCloudControl"); ds.Add("ASPxHtmlEditor"); ds.Add("ASPxPivotGrid"); return ds; }The gridview adds five blank row. It sees the items but doesn't display them.
Here's the grid markup:
<dx:ASPxGridView ID="gvResults" runat="server" AutoGenerateColumns="False"> <SettingsPager Visible="False"> </SettingsPager> <SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" /> </dx:ASPxGridView>
Tuesday, June 17, 2014 4:18 PM
Answers
-
User-1360095595 posted
Not sure but try setting autogeneratecolumns true.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, June 17, 2014 4:28 PM
All replies
-
User-1360095595 posted
Not sure but try setting autogeneratecolumns true.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, June 17, 2014 4:28 PM -
User1135810773 posted
Making it TRUE resolved the issue. However, I'm using a DevExpress Grid Control and I need two editable columns next to this dynamic one so the users and enter values. I'm not sure if this can be accomplished with autogeneratecolumns set to TRUE. But, I could be wrong.
Thoughts?
Tuesday, June 17, 2014 4:37 PM -
User-1360095595 posted
If it's anything like a regular gridview you'll need to set up templates for viewing/editing. In those templates you specify which columns to show and what controls to use for that.
Wednesday, June 18, 2014 2:13 AM -
User1135810773 posted
Thanks again!
Wednesday, June 18, 2014 8:55 AM