Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8704845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:12:50+00:00 2026-06-13T03:12:50+00:00

I am using RadControls for WinForms 2011 Q3 The datasource for a RadGridView is

  • 0

I am using RadControls for WinForms 2011 Q3

The datasource for a RadGridView is dynamically generated based on users’ input/selection
Everytime when a datasource is generated, I will call SetDatasource2KeyValuesGrid()
What I expect to see is columns generated and values filled in gridview.
However what I see is columns generated but no value filled even though the number of rows in gridview match the number of items in its datasource(keyValuesList)
I must have missed something simple. Please help. thanks

Edit:
I create a DataTable from the list keyValueList, and then assign it to DataSource, then it works
Just wonder if there’s a better way. thanks

private void CreateTableSetDatasource(List<FeedKeyValueOneSet>) keyValueList)
{
    if(keyValueList==null) return;

    var table = new DataTable();
    table.Columns.Add("Check");
    foreach (var feedKeyValueOneSet in keyValueList)
    {
        var oneset = feedKeyValueOneSet.KeyValueOneSet;               
        foreach (var oneKey in oneset)
        {
            table.Columns.Add(oneKey.key);
        }
        break;
    }

    foreach (var feedKeyValueOneSet in keyValueList)
    {
        var oneset = feedKeyValueOneSet.KeyValueOneSet;
        var numOfCol = oneset.Length + 1;
        var obj = new object[numOfCol];
        obj[0] = "false";
        int idx = 1;
        foreach (var oneKey in oneset)
        {
            obj[idx] = oneKey.value;
            idx++;
        }
        table.Rows.Add(obj);
    }
    radGridKeyValues.DataSource = table;
}


private void SetDatasource2KeyValuesGrid()
{
    if (radGridKeyValues.Columns != null) radGridKeyValues.Columns.Clear();
    radGridKeyValues.AutoGenerateColumns = false;
    radGridKeyValues.EnableFiltering = false;
    radGridKeyValues.ShowFilteringRow = false;
    radGridKeyValues.ShowHeaderCellButtons = false;
    radGridKeyValues.AllowDragToGroup = false;
    radGridKeyValues.AllowAddNewRow = false;
    radGridKeyValues.EnableGrouping = false;

    var keyValueList = (List<FeedKeyValueOneSet>)TimeSeries.FeedValuesCache[m_strFeedName + "_KEYVALUES"];
    if(keyValueList==null) return;

    GridViewDataColumn checkBoxColumn = new GridViewCheckBoxColumn("columnState", "columnState");
    checkBoxColumn.HeaderText = string.Empty;
    if (radGridKeyValues.Columns != null) radGridKeyValues.Columns.Add(checkBoxColumn);

    foreach (var feedKeyValueOneSet in keyValueList)
    {
        var oneset = feedKeyValueOneSet.KeyValueOneSet;
        foreach (var oneKey in oneset)
        {
            var textboxCol = new GridViewTextBoxColumn(oneKey.key, oneKey.key);
            textboxCol.Width = 150;
            textboxCol.ReadOnly = true;
            if (radGridKeyValues.Columns != null) radGridKeyValues.Columns.Add(textboxCol);
        }
        break;
    }

    radGridKeyValues.DataSource = keyValueList;
}

public class FeedKeyValueOneSet
{
    public FeedFieldValues[] KeyValueOneSet;
}

public class FeedFieldValues
{
    public string key { get; set; }
    public string value { get; set; }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:12:51+00:00Added an answer on June 13, 2026 at 3:12 am

    I create a DataTable from the list keyValueList, and then assign it to DataSource, then it works
    see code in edit to the question

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started using RadControls so this question might be basic for you,
We are using Telerik radcontrols in our web form and I am trying to
I'm using Telerik RadControls for ASP.NET and wondered if there was any way to
At the moment I'm using Silverlight RadControls from Telerik. In my site I've implemented
I am using RadTreeView from Telerik's Silverlight RadControls. My XAML for the RadTreeView is
I am using third party server-side controls on my website (Telerik RadControls for ASP
I am using rad:radgrid datagrid control. I need to change column header text dynamically.
Greetings Everyone I am new in asp.net and i'm using RadControls for Asp.net Ajax
I am developing a Wpf application using Telerik RadControls. Do you know any of
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.