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
4110
UltraWebGrid-Row Edit controls not initializing
posted

Please help. I have an UltraWebGrid (inside an update panel with a masterpage). Previously, I was able to determine the row ID that is assigned to textbox (hidden) in the RowEditTemplate and save the appropriate record. Now I've done something that isn't allowing the textbox to retain a value and I'm not sure what I have done. This is loaded dynamically once in the page_load event. Below is my code and html. Can someone please help. I just need to get the txtbox in the RowEditTemplate to initialize/retain the selected record id. I am using Infragistics 3.5 v10.3 controls. The controls in my RowEditTemplate are all asp controls, not regular input controls. Thanks.

 <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="block" UpdateMode="Conditional">
 <ContentTemplate>
  <igtbl:UltraWebGrid ID="igMyGrid" runat="server" EnableAppStyling="True"
   StyleSetName="Office2007Blue" StyleSetPath="~/ig_res/" DisplayLayout-CellPaddingDefault="5">
   <Bands>
    <igtbl:UltraGridBand>
     <Columns>
      <igtbl:UltraGridColumn BaseColumnName="ID" Key="ID" Hidden="true">
      </igtbl:UltraGridColumn>
      <igtbl:UltraGridColumn BaseColumnName="NAME" Key="NAME">
       <Header Caption="Name">
        <RowLayoutColumnInfo OriginX="4" />
       </Header>
       <HeaderStyle HorizontalAlign="Left" />
       <CellStyle HorizontalAlign="Left" />
       <Footer>
        <RowLayoutColumnInfo OriginX="4" />
       </Footer>
      </igtbl:UltraGridColumn>
      <igtbl:UltraGridColumn BaseColumnName="VALUE" Key="VALUE">
       <Header Caption="Value">
        <RowLayoutColumnInfo OriginX="5" />
       </Header>
       <HeaderStyle HorizontalAlign="Center" />
       <CellStyle HorizontalAlign="Center" />
       <Footer>
        <RowLayoutColumnInfo OriginX="5" />
       </Footer>
      </igtbl:UltraGridColumn>
      <igtbl:UltraGridColumn BaseColumnName="OTHERTEXT" Key="OTHERTEXT">
       <Header Caption="Other Text">
        <RowLayoutColumnInfo OriginX="7" />
       </Header>
       <HeaderStyle HorizontalAlign="Left" />
       <CellStyle HorizontalAlign="Left" />
       <Footer>
        <RowLayoutColumnInfo OriginX="7" />
       </Footer>
      </igtbl:UltraGridColumn>
     </Columns>
     <RowEditTemplate>
      <div id="divMyGridControls_A" style="background-color: #E5ECFD; width: 550px;" visible="false">
       <p align="left" style="padding: 2px 2px 2px 2px; border-color: Lightgray; border-width: 1px;
        border-style: solid;">
        <asp:Table ID="tblMyGridControlsA" runat="server">
         <asp:TableRow Visible="false">
          <asp:TableCell>
           <asp:Label ID="lblMyGridIDA" runat="server" columnkey="ID"></asp:Label>
          </asp:TableCell>
          <asp:TableCell>
           <asp:TextBox ID="txtMyGridIDA" runat="server" Enabled="false" ToolTip="ID" columnkey="ID"
            BorderStyle="none" BackColor="#E5ECFD" ForeColor="#E5ECFD" Font-Size="0"></asp:TextBox>
          </asp:TableCell>
         </asp:TableRow>
         <asp:TableRow>
          <asp:TableCell VerticalAlign="Top">
           <asp:Label ID="lblName" runat="server" Text="Value" Width="75px"></asp:Label>
          </asp:TableCell>
          <asp:TableCell>
           <asp:RadioButtonList ID="rblValueA" runat="server" RepeatDirection="Horizontal" columnkey="VALUE">
            <asp:ListItem Text="Satisfied" Value="0"></asp:ListItem>
            <asp:ListItem Text="Unsatisfied" Value="1"></asp:ListItem>
            <asp:ListItem Text="Not Used" Value="2"></asp:ListItem>
            <asp:ListItem Text="Not Applicable" Value="3" Selected="True"></asp:ListItem>
           </asp:RadioButtonList>
          </asp:TableCell>
         </asp:TableRow>
         <asp:TableRow>
          <asp:TableCell VerticalAlign="Top">
           <asp:Label ID="lblMyGridOtherText" runat="server"><br />Other</asp:Label>
          </asp:TableCell>
          <asp:TableCell>
           <button id="btnMyGridOtherText" runat="server" style="font-size: 8pt; width: 80px;
            cursor: pointer;" tabindex="3" type="button">
            Check Spelling</button><br />
           <asp:TextBox ID="txtMyGridOtherText" runat="server" columnkey="OTHERTEXT" Width="550px"
            TextMode="MultiLine" Rows="3"></asp:TextBox>
          </asp:TableCell>
         </asp:TableRow>
        </asp:Table>
       </p>
       <p align="center" style="background-color: #D5DDEA; vertical-align: middle; padding: 2px 2px 0px 2px;
        border-color: Gray; border-width: 1px; border-style: solid;">
        <asp:ImageButton ID="ibtnMyGridOK_A" runat="server" ImageUrl="~/Images/oknew.png"
         OnClick="ibtnMyGridOKA_Click" />
        <asp:ImageButton ID="ibtnMyGridCancel_A" runat="server" ImageUrl="~/Images/cancelnew.png" />
       </p>
      </div>
     </RowEditTemplate>
     <RowTemplateStyle Wrap="true">
     </RowTemplateStyle>
     <AddNewRow View="Bottom" Visible="Yes">
     </AddNewRow>
    </igtbl:UltraGridBand>
   </Bands>
   <DisplayLayout Name="igMyGrid" AllowDeleteDefault="No" AllowSortingDefault="No"
    AllowUpdateDefault="RowTemplateOnly" BorderCollapseDefault="Separate" CellPaddingDefault="5"
    AutoGenerateColumns="false" HeaderClickActionDefault="SortSingle" RowSelectorsDefault="Yes"
    RowHeightDefault="20px" NoDataMessage="No Data To Display"
    HeaderStyleDefault-Cursor="Hand" Version="4.00" CellClickActionDefault="Edit"
    SelectTypeRowDefault="Single" AllowAddNewDefault="No" AddNewRowDefault-Visible="No"
    ColHeadersVisibleDefault="Yes" HeaderStyleDefault-Height="10px" >
    <ClientSideEvents BeforeRowTemplateOpenHandler="igMyGrid_BeforeRowTemplateOpenHandler" />
    <FrameStyle>
    </FrameStyle>
    <ActivationObject BorderColor="" BorderWidth="">
    </ActivationObject>
   </DisplayLayout>
  </igtbl:UltraWebGrid>
  </ContentTemplate>
</asp:UpdatePanel>


#Region "igMyGrid Grid Methods"
  
    Protected Sub igMyGrid_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.LayoutEventArgs) Handles igMyGrid.InitializeLayout
        Try
            SetMyGridControls()
        Catch ex As Exception
        End Try
        With e.Layout.Bands(0).Columns.FromKey("ID")
            .Header.Caption = "ID"
            .Header.Style.HorizontalAlign = HorizontalAlign.Center
            .CellStyle.HorizontalAlign = HorizontalAlign.Center
            .Width = Unit.Pixel(25)
            .Hidden = True
        End With
        With e.Layout.Bands(0).Columns.FromKey("NAME")
            .Header.Caption = " "
            .Header.Style.HorizontalAlign = HorizontalAlign.Left
            .CellStyle.HorizontalAlign = HorizontalAlign.Left
            .Width = Unit.Pixel(255)
            .CellStyle.Wrap = True
            .CellStyle.BackColor = Drawing.ColorTranslator.FromHtml(Office2007Background2)
        End With
        With e.Layout.Bands(0).Columns.FromKey("VALUE")
            .Header.Caption = " "
            .Header.Style.HorizontalAlign = HorizontalAlign.Center
            .CellStyle.HorizontalAlign = HorizontalAlign.Center
            .Width = Unit.Pixel(425)
            .CellStyle.Wrap = True
        End With
         With e.Layout.Bands(0).Columns.FromKey("OTHERTEXT")
            .Header.Caption = "Other"
            .Header.Style.HorizontalAlign = HorizontalAlign.Left
            .CellStyle.HorizontalAlign = HorizontalAlign.Left
            .Width = Unit.Pixel(325)
            .Hidden = True
        End With

    End Sub

    Protected Sub igMyGrid_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.RowEventArgs) Handles igMyGrid.InitializeRow
        Dim Profile() As String = GetUserProfile(GetUser(Page.User.Identity.Name))
        Dim rblValueA As RadioButtonList = igMyGrid.Bands(0).RowEditItem.FindControl("rblValueA")
        Dim rblValueB As RadioButtonList = igMyGrid.Bands(0).RowEditItem.FindControl("rblValueB")

        Try
            If Not IsNothing(rblValueA) Then
                rblValueA.SelectedIndex = e.Row.Cells(4).Text
            End If
        Catch ex As Exception
        End Try
        Try
            If Not IsNothing(rblValueB) Then
                rblValueB.SelectedIndex = e.Row.Cells(4).Text
            End If
        Catch ex As Exception
        End Try
    End Sub

    Protected Sub ibtnMyGridOKA_Click()
        CheckItemsA()
    End Sub

    Private Sub CheckItemsA()
        Dim Profile() As String = GetUserProfile(GetUser(Page.User.Identity.Name))
        Dim tSurveyIDA As TextBox = igMyGrid.Bands(0).RowEditItem.FindControl("txtMyGridIDA")
        Dim rblValueA As RadioButtonList = igMyGrid.Bands(0).RowEditItem.FindControl("rblValueA")
        Dim tOtherText As TextBox = igMyGrid.Bands(0).RowEditItem.FindControl("txtMyGridOther")
        Dim MyGridItems(4) As String

        Try

            If Not IsNothing(tSurveyIDA) Then
                MyGridItems(0) = tSurveyIDA.Text.Trim
            End If
            If Not IsNothing(rblValueA) Then
                MyGridItems(1) = rblValueA.SelectedIndex
            End If
            MyGridItems(2) = "0"
            MyGridItems(3) = Today.ToShortDateString
            If Not IsNothing(tOtherText) Then
                MyGridItems(4) = tOtherText.Text.Trim
            End If

            UpdateMyGridData(MyGridItems, Profile)
            LoadData()
        Catch ex As Exception
        End Try
    End Sub

#End Region

Parents
No Data
Reply
  • 4110
    Verified Answer
    posted

    This is okay now. I think what happened is that I needed to just close IE and restart the project. It seems I had some caching issues due to a number of changes I made on clientside.

Children
No Data