This is a migrated thread and some comments may be shown as answers.

Radgrid column name change progrmatically

5 Answers 750 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Karthik
Top achievements
Rank 1
Karthik asked on 12 Oct 2012, 11:46 AM
Hi Telerik,
I got 2 forms...I got some datagridview in the form2. I want to change the column header names into French when the user clicks on the french button.

I have created a method in Form2 and called from Form 1:
I made the radgrid modifiers to public and the radpageview changed to public.  When i excute it nothing is changing. When i test with RadMessagebox, it works.

Please assist me. Thannk you.
private void radButton1_Click(object sender, EventArgs e)
     {
         timer1.Enabled = true;
         radLabel1.Visible = true;
         radProgressBar1.Visible = true;
         var f = new Form1();
         f.changeRadGridview();
 
     }
//Form 2 where I want to change the col name of the radgrid
internal  void changeRadGridview()
        {
           
            radGridView1.Columns[2].HeaderText = "First Name";
            radLabel5.Text = "hi";
        }

5 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 07 Nov 2012, 11:20 AM
Hello,

Why are you always creating a new instance of Form1?

Aren't you already in Form1? If so, just call this.changeRadGridview();

I believe you have a problem with the fields you are working with, because you are creating a new form there but you are not displaying it.

If you have any other questions, please let me know.

Best Regards,
Emanuel Varga
Winforms MVP
0
Karthik
Top achievements
Rank 1
answered on 07 Nov 2012, 11:41 AM
Hi Telerik,
It was mu mistake. I fixed that problem. Thank you.

0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 07 Nov 2012, 11:48 AM
Hello again,

Glad to be able to help, if this solved your problem, please mark the appropriate answer so that other users will be able to find their answer quicker,

Thank you,

Best Regards,
Emanuel Varga
Winforms MVP
0
Aravind
Top achievements
Rank 1
answered on 26 Dec 2012, 06:53 AM
hi 
i want small example for edit,update, cancel,delete and insert fro radgrid view using sql server,just 4 fields with rad textbox,rad dropdown list,date and check box in widows application with vb language
0
Julian Benkov
Telerik team
answered on 27 Dec 2012, 02:56 PM
Hello Aravind,

To implement this functionality and use RadGridView with support for all CRUD operations you can define Typed DataSet mapped to your SQL Server database and bind the DataTables from it to the grid. The data must be loaded using the Fill method of the generated SqlDataAdapter. After the data is changed in the RadGridView UI you can update the database using the Update method of the same SqlDataAdapter. More information about this topic you can find in the online MSDN documentation

Information about binding and usage of GridViewComboBox column you can find in our online documentation. Here you can find information about the usage of GridViewCheckBoxColumn.

I hope this information is useful. Let me know if you need further assistance.

Regards,
Julian Benkov
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
GridView
Asked by
Karthik
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Karthik
Top achievements
Rank 1
Aravind
Top achievements
Rank 1
Julian Benkov
Telerik team
Share this question
or