User (Old forums)MemberJanuary 7, 2009 at 2:33 pmPost count: 23064
I have searched the forums but haven’t been able to find anything talking about how to programmatically group a grid and disallow the user to dynamically group the data presented. I found an answer to a similar question but it wasn’t exactly what I was looking for and was also in C. I am using VB so if you can help out please use examples in visual basic. If I haven’t provided enough info just let me know what else you need to know and I’ll provide it.
Imported from legacy forums. Posted by Jeff (had 1540 views)User (Old forums)MemberJanuary 8, 2009 at 1:02 pmPost count: 23064
Well, I’ve found some code in the documentation that should work but fomr some reason I still can’t get the grid to group for me. I have included some code this time. If any of you can see what I am doing wrong I would appreciate the help.
Sub WorkStations_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objConn As OleDbConnection = New OleDbConnection(“Server=HRCANVSOPS\OPSTORE1;uid=*******;pwd=*******;database=OSP; Application Name=OSP;Provider=SQLOLEDB”)
Dim DataRead As New DataSet
Dim cmdData As OleDbDataAdapter = New OleDbDataAdapter(“Select OfficeID, DistrictIk, NumWorkStations, BusinessTypeID, CreatedBy, CreatedDate From OfficeWorkStations”, objConn)
Dim cb As New OleDbCommandBuilder(cmdData)
cmdData.InsertCommand = cb.GetInsertCommand()
cmdData.DeleteCommand = cb.GetDeleteCommand()
cmdData.UpdateCommand = cb.GetUpdateCommand()
GridControl1.DataSource = DataRead
Dim group As New Group()
Imported from legacy forums. Posted by Jeff (had 511 views)User (Old forums)MemberJanuary 8, 2009 at 1:24 pmPost count: 23064
Ok, I figured it out… What they don’t tell you in the documentaton is that if your grid already contains data you need to call
Anyway, hopfully this helps someone out.
Imported from legacy forums. Posted by Jeff (had 776 views)
- You must be logged in to reply to this topic.