StrataFrame Forum

About GridControl (DevExpress), please help me

http://forum.strataframe.net/Topic18807.aspx

By Robinson Robinsonit Robinson_niit - 8/27/2008



'

'get value of current row

'

Private Sub loadQByID_Grid()

Dim ds As New DataSet()

Dim dr As DataGridViewRow = gv.CurrentRow

Dim str As Integer = Convert.ToInt16(dr.Cells(0).Value.ToString())

Try

ds = getQuestionByID(str)

txtContent.Text = ds.Tables(0).Rows(0).Item(1)

Catch ex As Exception

Dim strError As String = "Error : " + ex.Message()

End Try

End Sub





This above code, I use DataGridView.

I want to use GridControl (DevExpress).

But when I used it, I don't see any object DataGridViewRow and method CurrentRow

How do I use GridControl (DevExpress) to get value of current row.

Please help me

Regards

PS: you can use C# to solve
By Bill Cunnien - 8/27/2008

int mColValue = (int)MyGridView.GetFocusedRowCellValue("MyFieldName");

Bill

By Robinson Robinsonit Robinson_niit - 8/27/2008

thanks Bill

But how do I declare MyGirdView?
By Bill Cunnien - 8/28/2008

A grid control can have many grid views.  A new instance of the grid control will have one grid view by default (gridView1).  Using the designer you can rename it, add new views, etc.  I just used the sample naming convention of "MyGridView" just to give you an idea of how to access the data in the grid.

Have fun!
Bill

By Robinson Robinsonit Robinson_niit - 8/29/2008

thanks so much, Bill

I have another problem to ask youTongue

I have a function returns a datatable, this has two columns (ID,Name)

And I have a GridControl

At Run Design, I add a column name colName

I want to bind data from column Name of that tableto column of GridControl

How can I do?

Please help me?

thanks again



PS: I'm Vietnamese. so my English is so bad, apology Tongue
By Bill Cunnien - 8/29/2008

No need to apologize...I am so glad that we are able to communicate.  That is wonderful!

If the datasource is available at design-time, then the columns will be setup with the default bindings; however, if it is not available, then you will need to specify the FieldName for each column.  The FieldName property is categorized under the Data section when viewing the Columns in the Designer.  The Caption property, located in the Appearance section, will set the name of the header in the column.

Hope that helps!
Bill

By Amna Elahi - 1/28/2010

Smile hi ... I m very New to development.. m a student working on a project and i want to clear my

Master Detail View.. M using Third party tool Named DevExpress version 9.0

I have a three Tables Linked togather .

Table1.... ProcedureMaster ...........(ProcedureID,ProductID,EntryDate)

Table2....ProcedureDetail...............(procedureID,Stage#,StdTime,ProcedureDescription)

Table3....ProcedureDetail2..............(ProcedureID,StageNo,MaterialID,Qty)





This is A concept to define a standard Procedure for a Product for Production Purpose...

Now Table2 will be bind in Grid and i have to manage table3 using grid also...

Please help me on this.

It is when i Will enter One Procedure Detail then i have to Enter Many Materials Against One Stage#...

Help...

Thanks in Advance
By Trent L. Taylor - 1/30/2010

Amna,



I believe that you are trying to just setup the parent-child relationships if I am not mistaken. There are a number of samples on this as well as documentation. As far as binding to a grid, that is great. You will want to use the BusinessBindingSource that wraps a BO and allows direct binding to a grid.



My first suggestion would be to download and install the StrataFlix sample. This sample shows everything that you are trying to do in regards to setting up parent-child relationships as well as using our ChildFormDialog (if necessary). Adding in the grid portion is the easy part.



This might be the best place to start and then we can field questions from there.