How to pass multiple rows from one gridview to another
gridview after clicking the checkbox.
Answer / srividhya
int i;
DataTable ObjDT = new DataTable();
DataColumn objcol1 = new DataColumn();
objcol1.DataType =
System.Type.GetType("System.Int16");
objcol1.ColumnName = "Category_id";
ObjDT.Columns.Add(objcol1);
DataColumn objcol2 = new DataColumn();
objcol2.DataType =
System.Type.GetType("System.String");
objcol2.ColumnName = "Category_Name";
ObjDT.Columns.Add(objcol2);
DataColumn objcol3 = new DataColumn();
objcol3.DataType =
System.Type.GetType("System.String");
objcol3.ColumnName = "Description";
ObjDT.Columns.Add(objcol3);
DataColumn objcol4 = new DataColumn();
objcol4.DataType =
System.Type.GetType("System.String");
objcol4.ColumnName = "Messages";
ObjDT.Columns.Add(objcol4);
for (i = 0; i < radGridView1.Rows.Count; i++)
{
if
(radGridView1.Rows[i].Cells[0].Value.ToString().ToUpper() ==
"TRUE")
{
DataRow ObjRow = ObjDT.NewRow();
ObjRow["Category_Id"] =
radGridView1.Rows[i].Cells[1].Value;
ObjRow["Category_Name"] =
radGridView1.Rows[i].Cells[2].Value;
ObjRow["Description"] =
radGridView1.Rows[i].Cells[3].Value;
ObjRow["Messages"] =
radGridView1.Rows[i].Cells[4].Value;
ObjDT.Rows.Add(ObjRow);
}
}
radGridView2.DataSource = ObjDT;
foreach (GridViewDataColumn column in
radGridView2.Columns)
{
column.BestFit();
}
Is This Answer Correct ? | 4 Yes | 1 No |
Coding for using Nullable Types in C#?
program for string reverse(eg:- i am boy -> boy am i)
8 Answers Black Pepper, Infosys, Mind Tree,
Hello Sir, Thanks for the Solution but, can you pls. Explain the coding for the Static Function & static variable from the below coding....waiting for Ans. class fact { public static void Main() { fact f=new fact(); int x=1; //Declaration of x as 1 int k=Convert.ToInt32(Console.ReadLine()); for(int i=1;i<=k;i++) { x= x *i; } System.Console.WriteLine(x); } }
Write a program to convert postfix expression to infix expression.
How to pass multiple rows from one gridview to another gridview after clicking the checkbox.
how do i copy textbox contents of 1 form to another form
Give the code for Handling Mouse Events?
working with arrays
Create a class called Accounts which has data members like ACCOUNT no, Customer name, Account type, Transaction type (d/w), amount, balance D->Deposit W->Withdrawal If transaction type is deposit call the credit(int amount) and update balance in this method. If transaction type is withdraw call debit(int amt) and update balance. Pass the other information like Account no,name,Account Type through constructor. Call the show data method to display the values.
Coding for Manipulate XML File Data Using C#?
. Write a program to print the following outputs using for loops $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
How to add a value from textBox over an existing certain column in SQL Server