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 8503937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:53:29+00:00 2026-06-11T01:53:29+00:00

I have a following string : for(#some conditions){ ## result += <tr><td> + dc

  • 0

I have a following string :

for(#some conditions){    
 ##
result += "<tr><td>" + dc + "</td><td>" + al + "</td><tr>"; 
}

Now, i want to show the load the vlaue of dc and al in my HTML input text area using the aspx:grid.

For example the value of result is:

result =  <tr><td>1111</td><td>23</td><td><tr><td>22222</td><td>43</td><tr>

Now i want to show the data in the following format using grid

dc       al
1111     23
222222   43

For now, I am filling the text area using the following commands.

<script type = "text/javascript">
    function submit_a()
    {
        $.post("../AllocationValidator.aspx", { "data": escape(validatorXML), "scenarioID": scenarioID }, function (result) {
            alert("Data Saved!");
            $("#allocations").empty();
            $("#allocations").html(result);
            BodyLoad();
        });
    }    
</script>

<div id = "allocations" style = "width: 650px; padding: 10px; border: 1px solid black;height: 150px; overflow:scroll;"></div>

My question is how to implement the asp:grid to display the data ?

  • 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-11T01:53:31+00:00Added an answer on June 11, 2026 at 1:53 am

    If you simply want to display your retrieved data in a GridView control. You can either bind a data source to the control or add columns and rows programmatically.

    You can bind any data sources that implement the IListSource or IList interface. This means that you cannot bind your result string directly, as noted in your question title. You have to store your retrieved data in a compatible data structure like for example a List to bind it as the data source.

    To use databinding, you could save your dc and al in a dictionary-like data structure. Assuming that you only want to display two columns of data.

    var data = new Dictionary<string, string>();
    for (/* Condition */)
    { 
        data.Add(dc, al);
    }
    grid.DataSource = data;
    grid.DataBind();
    

    The corresponding grid would be

    <asp:GridView ID="grid" runat="server" AutoGenerateColumns="false">
    <Columns>
        <asp:BoundField DataField="Key" HeaderText="dc"/>
        <asp:BoundField DataField="Value" HeaderText="al" />
    </Columns> 
    </asp:GridView>
    

    If you are using a foreach to generate your result string, than you should look at the possibility to use the object in the foreach statement as your data source.

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

Sidebar

Related Questions

I have the following String Sample however in some occurences there may be one
I have the following string: const char *str = \This is just some random
Suppose I have the following code: foreach(string str in someObj.GetMyStrings()) { // do some
I have a string like following: CREATE GLOBAL TEMPORARY TABLE some_temp_table_name or CREATE GLOBAL
I need some help writing a regex. I have the following strings, xxx.yyy.wwwwwaaa_IN_123 xxx.rrrttttt_IN_12355
I have the following code snippet where some strings are initialized in the if
I have following string: Test, User < test@test.com >, Another, Test < another@test.com >,
I have following situation: String a = A Web crawler is a computer program
I have the following string arrays: var myArray1 = new string[] {A, B, C};
I have the following: string test = CustomerNumber; or string test2 = CustomerNumberHello; the

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.