About GridControl (DevExpress), please help me


Author
Message
Robinson Robinsonit...
Robinson Robinsonit Robinson_niit
StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)
Group: Forum Members
Posts: 3, Visits: 8


'

'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

Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
int mColValue = (int)MyGridView.GetFocusedRowCellValue("MyFieldName");

Bill

Robinson Robinsonit...
Robinson Robinsonit Robinson_niit
StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)
Group: Forum Members
Posts: 3, Visits: 8
thanks Bill

But how do I declare MyGirdView?
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
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

Robinson Robinsonit...
Robinson Robinsonit Robinson_niit
StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)StrataFrame Beginner (3 reputation)
Group: Forum Members
Posts: 3, Visits: 8
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
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
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

Amna Elahi
Amna Elahi
StrataFrame Beginner (1 reputation)StrataFrame Beginner (1 reputation)StrataFrame Beginner (1 reputation)StrataFrame Beginner (1 reputation)StrataFrame Beginner (1 reputation)StrataFrame Beginner (1 reputation)StrataFrame Beginner (1 reputation)StrataFrame Beginner (1 reputation)StrataFrame Beginner (1 reputation)
Group: Forum Members
Posts: 1, Visits: 1
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
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search