We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to bind data to gridcontrol from database through code?

Thread ID:

Created:

Updated:

Platform:

Replies:

116173 Apr 18,2014 10:29 PM May 10,2014 03:42 AM Windows Forms 6
loading
Tags: GridControl
Venkata
Asked On April 18, 2014 10:29 PM

hi there, i already tried it some how, but it is not getting i paste my code check it

gridControl1.TableStyle.DataSource=dataTable;

i written like that, But i am not getting.

Maniratheenam Sehar [Syncfusion]
Replied On April 22, 2014 03:17 AM

Hi Venkata,

Thank you for your interest in Syncfusion product.

 In GridControl, we can’t able to bind the database directly to it. Instead, as a suggestion, you can make use of GridGroupingControl to bind the data source. But, if you still need to use GridControl, you can populate the values from the datasource. We have added a sample to understand how you can easily bind data to GridControl.

CodeSnippet[C#]:

            this.gridControl1.RowCount = table.Rows.Count;

            this.gridControl1.ColCount = table.Columns.Count;

            this.gridControl1.PopulateValues(GridRangeInfo.Cells(1, 1, gridControl1.RowCount, gridControl1.ColCount), table);

by using PopulateValues() you can bind the data into GridControl by providing Rowcount and ColCount values of the table(here datasource is a “table”).

 

Please let me know if you have any concerns.          

 Regards,

ManiRatheenam S


Attachment: WindowsFormsApplication11_5facbca3.zip

Venkata
Replied On April 24, 2014 09:14 AM

Hi Maniratheenam Sehar,
Thanks for your response. i have another doubt in Grid data Bound Grid can we do row wise operations. I am attaching a Application, Please check it, it will help us for better understanding my problem. I want those row wise operation in syncfusion GridDataBoundGrid  Control.

Regards
Venkata

Attachment: RowWiseOperation_30963d86.rar

Maniratheenam Sehar [Syncfusion]
Replied On April 25, 2014 07:33 AM

Hi Venkata,

We would like you to Know about  that the GridDataBoundGrid Control can also perform RowWise Operation. Here, by using CurrentCellShowedDropDown’ event in  GridDataBoundGrid Control which behaves same as ‘CellEnter’ event  which you have used in DataGridView Control, you can perform rowwise operation. We have added a sample below for your better convenience.

Please let us know if you have any further assistance. 

Regards,

ManiRatheenam S


Attachment: WindowsFormsApplication13_a1003b8a.zip

Venkata
Replied On April 25, 2014 12:37 PM

Hi ManiRatheenam S,
It works fine, thanks for your response.

Regards
Venkata

Venkata
Replied On April 29, 2014 12:29 PM

Hi Maniratheenam,

Can you tell me what is the alternate for RowValidating Event in syncfusion GridDataBoundGrid.

Solai A L [Syncfusion]
Replied On May 10, 2014 03:42 AM

Hi Venkata,

Thanks for the update.

We hope you got a solution for this query from your previous forum(116224) update. Please let us know if you have any other concerns.

Thanks & Regards,

AL.Solai.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;