Wrox Programmer Forums
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 29th, 2004, 12:13 PM
Authorized User
 
Join Date: Jun 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagrid issue

Is there a way to use the ASP version (System.Web.UI.WebControls.Datgrid) of the datagrid in a windows form in VB.Net? I have created an ASP presentation layer but the user is requesting a Windows form as well.

While I am on this in VB6 you use the 'command' function to read arguments issued when the program was started, how do you do that in VB.Net?

 
Old July 29th, 2004, 12:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

The Windows form version of the DataGrid has it's differences than the ASP.NET version, which no it is not possible, that I know of. You could potentially go the other way (host a VB.NET control in an ASP.NET web form).

Don't know the answer to the other.

Brian
 
Old July 29th, 2004, 01:21 PM
Authorized User
 
Join Date: Jun 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, I was afraid of that. :( My big issue with the Windows form grid is that in the web form I am accepting a collection from the next layer, and the windows form does not appear to allow collections it wants a DataView only. I am still looking into the old 'command' function.

 
Old July 29th, 2004, 03:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

It should allow collections, it should allow different kinds of collections, such as an array, a datatable, etc. Did you find a resource that says otherwise?

Brian
 
Old July 30th, 2004, 10:02 AM
Authorized User
 
Join Date: Jun 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No I did not find anything that said that, but when I bind the collection to the datagrid I get blank rows. Here is the code I am using to bing the collection and the map of the collection.


    'Message collection object
    ' MsgDate As Date
    ' Phone As String
    ' Length As int16
    ' Status As String
    ' VMKey as string
    ' FileLoc As String
    ' PromptFile As Boolean
    ' RecordID As Int64

    Private Sub GetMsgs()
        Dim Success As Boolean
        Dim msgStart As Double
        Dim msgEnd As Double
        colFilter = New Collection
        colVM = New Collection


  Cursor.Current = Cursors.WaitCursor

        If Not (IsNumeric(txtLen1.Text)) Then
            txtLen1.Text = 0
        End If

        If Not (IsNumeric(txtLen2.Text)) Then
            txtLen2.Text = 0
        End If

        If Not (IsDate(txtDate1.Text)) Then
            txtDate1.Text = ""
        End If

        If Not (IsDate(txtDate2.Text)) Then
            txtDate1.Text = ""
            txtDate2.Text = ""
            eDate = ""
        Else
            eDate = Convert.ToDateTime(txtDate2.Text).AddDays(1).ToStr ing
        End If

        msgStart = Convert.ToDouble(txtLen1.Text)
        msgEnd = Convert.ToDouble(txtLen2.Text)
        colFilter.Add(MakeCollection)

        Success = DVoice.FetchMessages(colFilter, colVM)

        If Success = True Then
            grdVM.CaptionText = "Found " & Format(colVM.Count, "###,###,##0") & " undeleted messages."
            Call BindGrid()
        Else
            grdVM.CaptionText = "No messages found. "
        End If

        Cursor.Current = Cursors.Arrow
    End Sub

    Private Sub butFetchRecords_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butFetchRecords.Click
        Call GetMsgs()
    End Sub

    Public Sub BindGrid()
        VMCount = 1
        grdVM.DataSource = colVM
    End Sub








Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Bound DataGrid Update Issue rodmcleay C# 2005 6 February 24th, 2007 10:44 PM
Updating Datagrid From Dataset Issue hannahforinton C# 2 May 30th, 2006 12:19 PM
Datagrid Radio button template column issue satyajitk ASP.NET 1.0 and 1.1 Professional 6 November 26th, 2005 01:48 AM
Tricky DataGrid Events Issue DudeBori82 ASP.NET 1.0 and 1.1 Professional 3 October 21st, 2005 04:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.