Welcome Guest Search | Active Topics | Sign In | Register

Grid Command Event Args Options
ROI.Solutions
Posted: Thursday, June 19, 2008 9:06:01 AM
Rank: Advanced Member
Groups: Member

Joined: 4/22/2008
Posts: 75
Hello,

I am in need of help. I cant seem to find out how to for an Event. I have a sub procedure that when an item is selected in the grid it prefills the form and works wonders. Great work by the way. But what i would like to do is on a page load i have some criteria called "Calendar_Index which is the item index of the grid whihc i pass in as a query string. I want to fore the gridCommandEvents args but dont know how. here is some sample code

Code: Visual Basic.NET
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        affiliateID = Request.QueryString("AID")
        If Not IsPostBack Then
            If Request.QueryString("Cal").ToString().Length > 0 Then
                'Called the Grid Event Sub Procedure Here to load a form
            Else
                loadDefaultForm()
            End If
            loadDefaultForm()
        End If
    End Sub


SUB PROCEDURE for EVEnt Handling
Code: Visual Basic.NET
Private Sub calendarGrid_itemSelected(ByVal sender As Object, ByVal e As EO.Web.GridCommandEventArgs) Handles calendarGrid.ItemCommand
        loadSpecificEOForm(e)
    End Sub
eo_support
Posted: Thursday, June 19, 2008 9:30:30 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,096
Hi Loren,

Do you mean you want to store the Calendar_Index value that you get from the QueryString into the GridCommandEventArgs object so that you can call calendarGrid_itemSelected in your Page_Load?

If that's the case, then you are out of luck there. Only our code can create/modify GridCommandEventArgs object, you can't. :) The easiest work around is to change your loadSpecificEOForm to take the value directly. Once you change it, your calendarGrid_itemSelected handler will be like:

loadSpecificEOForm(e.GridItem.Index)

And in your Page_Load will get the value from your query string and also call the method directly, instead of calling calendarGrid_itemSelected. As you can see, the idea is to go straight to the target and cut out of the middle man (calendarGrid_itemSelected).

Hope this helps.

Thanks!
ROI.Solutions
Posted: Thursday, June 19, 2008 9:45:20 AM
Rank: Advanced Member
Groups: Member

Joined: 4/22/2008
Posts: 75
thats is what i eventually did. however i did get part of it to work by calling y sub procedure like this

Calendargrid_itemSelected(new object(), new Eo.Web.gridCommandEventArgs(item, "CommandName") and it loaded the varibale holders just fine but for some reason would loop through Drop down etc so i moved to the other way that you sugested but it seems it can work just time i dont have right now on this project thank you for your time


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.