|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Migration of MSFLEXGRID to DATAGRID in vb.net...I am involved in the process of migrating vb(6.0) application to vb.net. My application contains only vb controls namely MSFLEXGRID. I want to migrate my application to vb.net completely without any OCX(MSFLEXGRID) controls. I found datagrid to be an equivalent control of MSFLEXGRID in vb.net. I am unable to find an equivalent method & property of datagrid in vb.net. Please provide some examples which helps me to migrate the MSFLEXGRID to datagrid in vb.net easily. Below vb code shows flexgrid properties: Sub InitCallInfo() On Error GoTo err_handler flexgrid.Rows = 50 With flexgrid .ColWidth(0) = 900 .ColWidth(1) = 3100 .ColWidth(2) = 1200 .Row = 0 .Col = 0 .CellFontBold = True .Text = "No.Calls" .Col = 1 .CellFontBold = True .Text = "Call Type" .Col = 2 .CellFontBold = True .Text = "Amount" End With cnPRU.sp_GetWTNDetail CurrentAcct 'cnPRU - SQL connection Set rsCalls = cnPRU.LastQueryResults j = 0 Do While Not rsCalls.EOF j = j + 1 flexgrid.Row = j With flexgrid .Col = 0 .CellFontBold = True .Text = rsCalls("NumCalls") .Col = 1 .CellFontBold = True .Text = rsCalls("Description") .Col = 2 .CellFontBold = True .Text = Format(rsCalls("CallDollars"), "$#,##0.00;($#,##0.00") End With rsCalls.MoveNext Loop rsCalls.Close flexgrid.Rows = j + 2 'set total number of rows flexgrid.Row = j + 1 With flexgrid .Col = 0 .CellBackColor = &HC0FFFF .CellFontBold = True .Text = intNumCalls .Col = 1 .CellBackColor = &HC0FFFF .CellFontBold = True .CellFontItalic = True .Text = "Total Calls" .Col = 2 .CellBackColor = &HC0FFFF .CellFontBold = True .Text = Format(curUBIC, "$#,##0.00;($#,##0.00") End With Exit_Procedure: Exit Sub err_handler: strErr = "Y" MsgBox Err.Description cnPRU.sp_InsertError1 Err.Number, Err.Description, "frmWorklist", "InitCallInfo" Resume Exit_Procedure End Sub Please provide equivalent properties of datagrid in vb.net to achieve the same output. Thank you! Zoneal,
Be aware that the DataGrid uses forever a datasource which is in your case a DataTable/Dataview/DataTable.Defaultview. Have than a look at our website. The datagrid part is full of samples which are completely stand alone. (The one that are not standalone can you use as well by the way, however than with creating the datatable as in the other samples) http://www.vb-tips.com/default.aspx I hope this helps, Cor
Reading Binary File in VS2005
Bug or By Design... number of lines in Richtextbox LRC Calculation algorithm What version of SQL Server can I install in my Windows XP PC and.. How to change a VB solution/project name? Releasing a loaded assembly in ASP.NET 2.0 Bind dinamicly dlls without createobject sending Fax from vb.net with Microsoft Fax Service Extended COM Type Libary end sub and breakpoints |
|||||||||||||||||||||||