Radgrid column name change progrmatically

6 posts, 1 answers
  1. Karthik
    Karthik avatar
    7 posts
    Member since:
    Oct 2012

    Posted 12 Oct 2012 Link to this post

    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";
            }
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 07 Nov 2012 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Karthik
    Karthik avatar
    7 posts
    Member since:
    Oct 2012

    Posted 07 Nov 2012 Link to this post

    Hi Telerik,
    It was mu mistake. I fixed that problem. Thank you.

  5. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 07 Nov 2012 Link to this post

    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
  6. Aravind
    Aravind avatar
    3 posts
    Member since:
    Nov 2012

    Posted 26 Dec 2012 Link to this post

    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
  7. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 27 Dec 2012 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready