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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:48:27+00:00 2026-05-30T01:48:27+00:00

I want to add a stored CustomDataGridViewRow into a DataGridView which is binded. Like

  • 0

I want to add a stored CustomDataGridViewRow into a DataGridView which is binded. Like follows:

CustomDataGridViewRow rowTemplate = new CustomDataGridViewRow();
dataGridView1.RowTemplate = rowTemplate;

Datenbank.cmd = 
    new SqlCommand("[Terminauswertung_Bericht_Gesamt]", Datenbank.connection);
Datenbank.cmd.CommandType = CommandType.StoredProcedure;
Datenbank.cmd.Parameters.AddWithValue("@berichtsnr", 1);

SqlDataAdapter adapter = new SqlDataAdapter(Datenbank.cmd);
dataSet1.Tables.Clear();
adapter.Fill(dataSet1, "Table");
bs = new BindingSource();
bs.DataSource = dataSet1.Tables["Table"];
dataGridView1.DataSource = bs;

Thought it goes this way:

dataSet1.Tables[0].Rows.Add(Cache.getRow(1));

public class cache
{
    Dictionary<int, CustomDataGridViewRow> _cache = 
        new Dictionary<int, CustomDataGridViewRow>();

    public CustomDataGridViewRow getRow(int index)
    {
        foreach (KeyValuePair<int, CustomDataGridViewRow> dic in _cache)
        {
            if (dic.Key == index)
                return (dic.Value);
        }
        return (new CustomDataGridViewRow());            
    }
}

But it only shows me DataGridViewRow { Index=1 } in first cell.

  • 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-05-30T01:48:28+00:00Added an answer on May 30, 2026 at 1:48 am

    solved it

    DataRow newRow =test.Tables[0].NewRow();
    
    
    newRow.ItemArray = Cache.getRowValues(child);
     test.Tables[0].Rows.InsertAt(newRow, c.Index+1);
    
     public string[] getRowValues(int index)
            {
                List<string> temp = new List<string>();
                foreach (KeyValuePair<int, CustomDataGridViewRow> dic in _cache)
                {
                    if (dic.Key == index)
                    {
                        foreach (DataGridViewCell cell in dic.Value.Cells)
                            temp.Add(cell.Value.ToString());
                    }
                }
                string[] result = temp.ToArray();
    
                return (result);
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to accomplish something like this. I want to add the text stored
If you're creating a temporary table within a stored procedure and want to add
I want to add column to table by stored procedure and the name of
I'm trying to modify a stored procedure hooked into an ORM tool. I want
I have a stored procedure which does sorting pnd Paging like the Sorting Custom
I want to add custom (compound and read-only) attributes to my stored procedure results
In a stored procedure (Oracle in my case), I want to add some values
Suppose I have a class MyClass to which I want to add certain 'observer'
I want to add a feature to search documents stored in a directory. The
I want to add my data stored in 2x2 dimension array in Excel using

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.