Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
CellSelectionChanged event problem
posted

I'm having a problem with the results of the cellselectionchanged event when working with a grid the has column filters applied.  Examples use this site:  http://test.medicalmethods.net/jobboard.aspx

If I click "Add+" (Add to Cart) in row 1 of the unfiltered grid the job I clicked appears in the job cart.  Click "Remove" and return to the job board.  Select "SNF" in the settings grid and click "Get Jobs". Click "Add+" in row 1 again (it will be a different job).  You will be sent to the job cart with the same job as the first time. If you use row 2 in each case you'll get row 2 of the unfiltered grid each time.

I'm more of a client-server programmer than a web guy so I may be going about this wrong. I know there may be a javascript solution but I want to stick with the VB because I'm more comfortable with it.

The grid:

                                            <ig:WebDataGrid ID="grdJobs" runat="server" DataSourceID="dataJobs" EnableDataViewState="True"

                                                OnSorting="gridSorting" StyleSetName="MedicalMethods" 

                                            EnableAjax="False" Width="100%"

                                                AutoGenerateColumns="False">

                                                <Behaviors>

                                                    <ig:Selection>

                                                        <AutoPostBackFlags CellSelectionChanged="True" />

                                                    </ig:Selection>

                                                    <ig:Activation>

                                                    </ig:Activation>

                                                    <ig:Paging PagerAppearance="Both" PagerMode="NumericFirstLast" QuickPages="3" PageSize="25"

                                                        FirstPageText="First" LastPageText="Last">

                                                    </ig:Paging>

                                                    <ig:Sorting>

                                                    </ig:Sorting>

                                                    <ig:Filtering Visibility="Hidden">

                                                    </ig:Filtering>

                                                </Behaviors>

                                                <Columns>

                                                    <ig:TemplateDataField Key="AddToCart" CssClass="jobboard-link" Hidden="false" Width="8%">

                                                        <ItemTemplate>

                                                            Add[+]

                                                        </ItemTemplate>

                                                        <Header Text="Add to cart" />

                                                    </ig:TemplateDataField>

                                                    <ig:BoundDataField DataFieldName="Profession" Key="Profession" Width="12%">

                                                        <Header Text="Profession" />

                                                    </ig:BoundDataField>

                                                    <ig:BoundDataField DataFieldName="Skill" Key="Skill" Width="12%">

                                                        <Header Text="Skill" />

                                                    </ig:BoundDataField>

                                                    <ig:BoundDataField DataFieldName="Setting" Key="Setting" Width="10%">

                                                        <Header Text="Setting" />

                                                    </ig:BoundDataField>

                                                    <ig:BoundDataField DataFieldName="Shift" Key="Shift" Width="10%">

                                                        <Header Text="Shift" />

                                                    </ig:BoundDataField>

                                                    <ig:BoundDataField DataFieldName="Schedule" Key="Schedule" Width="10%">

                                                        <Header Text="Schedule" />

                                                    </ig:BoundDataField>

                                                    <ig:BoundDataField DataFieldName="JobOpeningType" Hidden="true" Key="JobOpeningType"

                                                        Width="10%">

                                                        <Header Text="Job Type" />

                                                    </ig:BoundDataField>

                                                    <ig:BoundDataField DataFieldName="City" Key="City" Width="10%">

                                                        <Header Text="City" />

                                                    </ig:BoundDataField>

                                                    <ig:BoundDataField DataFieldName="StateAbbrev" Key="StateAbbrev" Width="8%">

                                                        <Header Text="State" />

                                                    </ig:BoundDataField>

                                                    <ig:BoundDataField DataFieldName="Pay" Hidden="true" CssClass="hide" Key="Pay" DataFormatString="{0:c}"

                                                        DataType="decimal">

                                                        <Header Text="Pay" />

                                                    </ig:BoundDataField>

                                                    <ig:BoundDataField DataFieldName="intJobId" Hidden="false" Key="intJobId">

                                                        <Header Text="Job ID" />

                                                    </ig:BoundDataField>

                                                    <ig:TemplateDataField Key="JobDetails" CssClass="jobboard-link" Width="10%">

                                                        <ItemTemplate>

                                                            <a href="jobdetails.aspx?id=<%#Eval("intJobId") %>">Details </a>

                                                        </ItemTemplate>

                                                        <Header Text="" />

                                                    </ig:TemplateDataField>

                                                </Columns>

                                                <AjaxIndicator ImageUrl="~/images/ajax-loader.gif" Enabled="True" Location="AboveCenter" />

                                            </ig:WebDataGrid>

 

The VB

    Private Sub grdJobs_CellSelectionChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.GridControls.SelectedCellEventArgs) Handles grdJobs.CellSelectionChanged

        Try

            Dim Job1 As New Job

 

            Job1.JobID = e.CurrentSelectedCells(0).Row.Items(COL_JOBID).Value & "-" & Now.Ticks.ToString

            Job1.Profession = e.CurrentSelectedCells(0).Row.Items(COL_PROFFESSION).Value

            Job1.setting = e.CurrentSelectedCells(0).Row.Items(COL_SETTING).Value

            Job1.Skill = e.CurrentSelectedCells(0).Row.Items(COL_SKILL).Value

            Job1.Shift = e.CurrentSelectedCells(0).Row.Items(COL_SHIFT).Value

            Job1.schedule = e.CurrentSelectedCells(0).Row.Items(COL_SCHEDULE).Value

            Job1.jobType = e.CurrentSelectedCells(0).Row.Items(COL_JOBOPENINGTYPE).Value

            Job1.City = e.CurrentSelectedCells(0).Row.Items(COL_CITY).Value

            Job1.State = e.CurrentSelectedCells(0).Row.Items(COL_STATE).Value

            Job1.strJobID = e.CurrentSelectedCells(0).Row.Items(COL_JOBID).Value.ToString

 

            Dim CartItem As New CartItem

            CartItem.Job = Job1

            Me.AddToCart(CartItem)

            Response.Redirect("jobcart.aspx")

        Catch ex As Exception

            'Utilities.SendMail(JobBoardConfig.MoreInfoEmail, JobBoardConfig.ErrorLogEmail, "ORTN website", "Error in CellSelectionChanged. Row: " & row.ToString & " col: " & col.ToString)

        End Try

    End Sub

Thank you in advance for any help.

Parents
No Data
Reply Children
No Data