Search Results

Search found 5 results on 1 pages for 'user329419'.

Page 1/1 | 1 

  • Hidden Field asp.net

    - by user329419
    I want to hide columns in asp.net in GridView then access the values in GridViewSelectIndexChanged using vb.net. I am using hidden fields in the GridView. When I try to access gives me an error object reference not set to an instance here is the code <asp:GridView ID="GridView1" runat="server" OnSorting="GridView1_OnSorting" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Outset" CellPadding="4" DataSourceID="odsA02_Tracking" ForeColor="#333333" GridLines="Vertical" Style="border-right: #0000ff thin solid; table-layout: auto; border-top: #0000ff thin solid; font-size: x-small; border-left: #0000ff thin solid; border-bottom: #0000ff thin solid; font-family: Arial; border-collapse: separate" Font-Size="Small" PageSize="30"> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#EFF3FB" /> <EditRowStyle BackColor="#2461BF" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="White" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:boundfield datafield="Since" HeaderText="Submit Date" ReadOnly=true SortExpression="Since" /> <asp:BoundField DataField="Started_By" HeaderText="Submitted By" SortExpression="Started_By" /> <asp:BoundField DataField="Client_FullName" HeaderText="Client Name" ReadOnly="True" SortExpression="Client_FullName" /> <asp:BoundField DataField="Product_Desc" HeaderText="Product" ReadOnly="True" SortExpression="Product_Desc" /> <asp:BoundField DataField="Branch_List" HeaderText="Branch" ReadOnly="True" SortExpression="Branch_List" /> <asp:BoundField DataField="Event_AssignedID" HeaderText="Assigned To" ReadOnly="True" SortExpression="Event_AssignedID" /> <asp:BoundField DataField="DaysElapsed" HeaderText="Days Open" ReadOnly="True" SortExpression="DaysElapsed" /> <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" /> <asp:TemplateField HeaderText=Instance_ID > <ItemTemplate> <asp:HiddenField ID=lblInstanceID Value='<%#Eval("Instance_ID") %>' runat=server> </asp:HiddenField> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText=Seq_ID> <ItemTemplate> <asp:HiddenField ID=lblSeqID Value='<%#Eval("Seq_ID") %>' runat=server/> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText=Form_Code> <ItemTemplate> <asp:HiddenField ID=lblFormCode Value='<%#Eval("Form_Code") %>' runat=server/> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged Dim Instance_ID As String Dim Seq_ID As String Dim Form_Code As String Dim PARMS As String Dim DestinationURL As String Dim DestinationParms As String Dim instanceID As String = CType(GridView1.FindControl("lblInstanceID"), HiddenField).Value End sub

    Read the article

  • Asp.Net GridView

    - by user329419
    I need to hide columns in GridView Then access the values of these in the GridViewSelectedIndexChanged using vb.net. When I set DataBound columns is false cant acces the values. Please help. <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Outset" CellPadding="4" DataSourceID="odsA02_Tracking" Font-Size="Small" ForeColor="#333333" GridLines="Vertical" Style="border-right: #0000ff thin solid; table-layout: auto; border-top: #0000ff thin solid; font-size: x-small; border-left: #0000ff thin solid; border-bottom: #0000ff thin solid; font-family: Arial; border-collapse: separate" PageSize="30"> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="Since" HeaderText="Submit Date" ReadOnly="True" SortExpression="Since" /> <asp:BoundField DataField="Started_By" HeaderText="Submitted By" SortExpression="Started_By" /> <asp:BoundField DataField="FullName" HeaderText="Client Name" ReadOnly="True" SortExpression="FullName" /> <asp:BoundField DataField="Product_Desc" HeaderText="Product" ReadOnly="True" SortExpression="Product_Desc" /> <asp:BoundField DataField="Branch_List" HeaderText="Branch" ReadOnly="True" SortExpression="Branch_List" /> <asp:BoundField DataField="Event_AssignedID" HeaderText="Assigned To" ReadOnly="True" SortExpression="Event_AssignedID" /> <asp:BoundField DataField="DaysElapsed" HeaderText="Days Open" ReadOnly="True" SortExpression="DaysElapsed" /> <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" /> <asp:BoundField DataField="Instance_ID" HeaderText="Instance_ID" SortExpression="Instance_ID" Visible=True /> <asp:TemplateField Visible=False> <ItemTemplate> <asp:HiddenField ID=hdnSeqID Value='<%#Eval("Seq_ID") %>' runat=server/> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="FormCode" Visible=false> <ItemTemplate> <asp:HiddenField ID=hdnFormCode Value='<%#Eval("Form_Code") %>' runat=server/> </ItemTemplate> </asp:TemplateField> </Columns> Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged Dim Instance_ID As String Dim Seq_ID As String Dim Form_Code As String Dim PARMS As String Dim DestinationURL As String Dim DestinationParms As String 'fill text box's with values from selected row ' store values from selected row Dim seqID As String = CType(GridView1.SelectedRow.FindControl("hdnSeqID"), HiddenField).Value Dim formCode As String = CType(GridView1.SelectedRow.FindControl("hdnFormCode"), HiddenField).Value End Sub

    Read the article

  • GridView on the select of row

    - by user329419
    I need to hide columns in GridView then access the values of these columns in GridViewSelectedIndex using vb.net When I set visible=false for Bound colums i cannot access the values <asp:TemplateField Visible=False> <ItemTemplate> <asp:HiddenField ID=hdnSeqID Value='<%#Eval("Seq_ID") %>' runat=server/> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="FormCode" Visible=false> <ItemTemplate> <asp:HiddenField ID=hdnFormCode Value='<%#Eval("Form_Code") %>' runat=server/> </ItemTemplate> </asp:TemplateField> </Columns> <RowStyle BackColor="#EFF3FB" /> <EditRowStyle BackColor="#2461BF" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged Dim Instance_ID As String Dim Seq_ID As String Dim Form_Code As String Dim PARMS As String Dim DestinationURL As String Dim DestinationParms As String 'fill text box's with values from selected row ' store values from selected row 'Dim instanceID As String = CType(GridView1.SelectedRow.FindControl("hdnInstanceID"), HiddenField).Value Dim seqID As String = CType(GridView1.SelectedRow.FindControl("hdnSeqID"), HiddenField).Value Dim formCode As String = CType(GridView1.SelectedRow.FindControl("hdnFormCode"), HiddenField).Value

    Read the article

  • GridView does not display correcty sorted Data when i click column

    - by user329419
    Date column does not display in sorted in GridView using vb.net. In sql server the select query is returning records in sorted manner or in order by. But for some reason GridView does not display properly. it goes to an event preRenderComplete then it binds automatically Protected Sub Page_PreRenderComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRenderComplete 'Force the selections made in page_load to be shown in the gridview by causing a postback GridView1.DataBind() If GridView1.Rows.Count > 0 Then 'this is not counting correctly disable until i get it figured out '' lblMsg.Text = GridView1.Rows.Count.ToString + " Referrals" Else lblMsg.Text() = "No referrals to be processed" End If 'Turn off the Background Contolls 'If Not IsPostBack Then PanelBackendControls.Visible = False End Sub End Region _ Public Shared Function A02WF01_AdminView(ByVal strUserID As String, ByVal strTestMode As String, ByVal strSearchFieldValue As String, ByVal strDate As String) As DataTable Dim sel As String Dim conn As SqlConnection = New SqlConnection(WF01ConnectionString) If strSearchFieldValue <> "" And strTestMode = "ON" Then sel = "SELECT DISTINCT Since, WorkFlow_Step, " sel = sel & " Started_By, Client_FullName, Product_Desc, " sel = sel & " Branch_List, Event_AssignedID, DaysElapsed, Status,Instance_ID,Seq_ID,Form_Code " sel = sel & " FROM A02W01ViewAllTest " Dim WhereClause As String Dim OrderClause As String WhereClause = " WHERE ( Event_IsLatest = 1)" If strUserID <> "Admin" Then End If 'WhereClause = WhereClause + " AND WF_Start_UserID like " + "'" + strUserID + "')" WhereClause = WhereClause + " And( Started_By Like " + "'%" + strSearchFieldValue + "%'" WhereClause = WhereClause + " OR Client_FullName Like " + "'%" + strSearchFieldValue + "%'" 'WhereClause = WhereClause + " OR FullName Like " + "'%" + strSearchFieldValue + "%'" WhereClause = WhereClause + " OR Product_Desc Like " + "'%" + strSearchFieldValue + "%'" WhereClause = WhereClause + " OR Branch_List Like " + "'%" + strSearchFieldValue + "%'" WhereClause = WhereClause + " OR DaysElapsed Like " + "'%" + strSearchFieldValue + "%')" 'WhereClause = WhereClause + " OR Form_Code Like " + "'%" + strSearchFieldValue + "%')" OrderClause = " ORDER BY Since DESC" sel = sel + WhereClause + OrderClause ElseIf strSearchFieldValue <> "" And strTestMode <> "ON" Then sel = "SELECT DISTINCT Since, WorkFlow_Step, " sel = sel & " Started_By, Client_FullName, Product_Desc, " sel = sel & " Branch_List, Event_AssignedID, DaysElapsed, Status " sel = sel & " FROM A02W01ViewAll " Dim WhereClause As String Dim OrderClause As String WhereClause = " WHERE ( Event_IsLatest = 1)" If strUserID <> "Admin" Then End If 'WhereClause = WhereClause + " AND WF_Start_UserID like " + "'" + strUserID + "')" WhereClause = WhereClause + " AND( Started_By Like " + "'%" + strSearchFieldValue + "%'" WhereClause = WhereClause + " OR Client_FullName Like " + "'%" + strSearchFieldValue + "%'" 'WhereClause = WhereClause + " OR Client_LastName Like " + "'%" + strSearchFieldValue + "%'" WhereClause = WhereClause + " OR Product_Desc Like " + "'%" + strSearchFieldValue + "%'" WhereClause = WhereClause + " OR Branch_List Like " + "'%" + strSearchFieldValue + "%'" WhereClause = WhereClause + " OR DaysElapsed Like " + "'%" + strSearchFieldValue + "%'))" 'WhereClause = WhereClause + " OR Form_Code Like " + "'%" + strSearchFieldValue + "%'))" OrderClause = " ORDER BY Since DESC" sel = sel + WhereClause + OrderClause End If If strTestMode <> "ON" And strSearchFieldValue = "" Then sel = "SELECT DISTINCT Since, WorkFlow_Step, " sel = sel & " Started_By, Client_LastName, Client_FullName, Product_Desc, " sel = sel & " Branch_List, Event_AssignedID, DaysElapsed, Status " sel = sel & " FROM A02W01ViewAll " Dim WhereClause As String Dim OrderClause As String WhereClause = " WHERE Event_IsLatest = 1" 'WhereClause = WhereClause + " AND (Event_IsLatest = 1) " OrderClause = " ORDER BY Since DESC" sel = sel + WhereClause + OrderClause Else If strSearchFieldValue = "" And strTestMode = "ON" And strDate = "" Then sel = "SELECT DISTINCT Since, WorkFlow_Step, " sel = sel & " Started_By, Client_FullName, Product_Desc, " sel = sel & " Branch_List, Event_AssignedID, DaysElapsed, Status, Instance_ID,Seq_ID,Form_Code " sel = sel & " FROM A02W01ViewAllTest " Dim WhereClause As String Dim OrderClause As String WhereClause = " WHERE Event_IsLatest = 1" 'Display everything for Admin ' Comment below code 'If strUserID <> "Admin" Then WhereClause = WhereClause + " AND WF_Start_UserID like " + "'" + strUserID + "'" OrderClause = " ORDER BY Since DESC" sel = sel + WhereClause + OrderClause ElseIf strSearchFieldValue = "" And strTestMode = "ON" And strDate <> "" Then sel = "" sel = sel & "SELECT TOP 100 PERCENT Since, WorkFlow_Step, " sel = sel & "Started_By, Client_Fullname, Product_Desc, " sel = sel & "Branch_List, Event_AssignedID, DaysElapsed, Status, " sel = sel & "Instance_ID, Seq_ID, Form_Code " sel = sel & " FROM A02W01ViewDistinct " Dim WhereClause As String Dim OrderClause As String WhereClause = " WHERE Event_IsLatest = 1" 'Display everything for Admin ' Comment below code 'If strUserID <> "Admin" Then WhereClause = WhereClause + " AND WF_Start_UserID like " + "'" + strUserID + "'" OrderClause = " ORDER BY YEAR(Since) DESC, MONTH(Since) DESC, DAY(Since) DESC" sel = sel + WhereClause + OrderClause End If End If Dim da As SqlDataAdapter = New SqlDataAdapter(sel, conn) Dim ds As DataSet = New DataSet() Try conn.Open() da.Fill(ds, "odsA02_Tracking") conn.Close() Catch e As SqlException WFClassLib.PageError() Finally conn.Close() End Try If ds.Tables("odsA02_Tracking") IsNot Nothing Then _ Return ds.Tables("odsA02_Tracking") 'Return ds 'If ds.Tables("odsA02_Tracking") Is Nothing Then Return Nothing 'End If End Function BorderStyle="Outset" CellPadding="4" DataSourceID="odsA02_Tracking" ForeColor="#333333" GridLines="Vertical" Style="border-right: #0000ff thin solid; table-layout: auto; border-top: #0000ff thin solid; font-size: x-small; border-left: #0000ff thin solid; border-bottom: #0000ff thin solid; font-family: Arial; border-collapse: separate" Font-Size="Small" PageSize="30" <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:boundfield datafield="Since" HeaderText="Submit Date" ReadOnly=True SortExpression="Since" /> <asp:BoundField DataField="Started_By" HeaderText="Submitted By" SortExpression="Started_By" /> <asp:BoundField DataField="Client_FullName" HeaderText="Client Name" ReadOnly="True" SortExpression="Client_FullName" /> <asp:BoundField DataField="Product_Desc" HeaderText="Product" ReadOnly="True" SortExpression="Product_Desc" /> <asp:BoundField DataField="Branch_List" HeaderText="Branch" ReadOnly="True" SortExpression="Branch_List" /> <asp:BoundField DataField="Event_AssignedID" HeaderText="Assigned To" ReadOnly="True" SortExpression="Event_AssignedID" /> <asp:BoundField DataField="DaysElapsed" HeaderText="Days Open" ReadOnly="True" SortExpression="DaysElapsed" /> <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" /> <asp:TemplateField> <ItemTemplate> <asp:HiddenField ID=hdnInstanceID Value='<%#Eval("Instance_ID") %>' runat=server> </asp:HiddenField> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:HiddenField ID=hdnSeqID Value='<%#Eval("Seq_ID") %>' runat=server/> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:HiddenField ID=hdnFormCode Value='<%#Eval("Form_Code") %>' runat=server/> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> &nbsp;&nbsp; <asp:Label ID="lblMsg" runat="server" Style="font-size: small; color: red; font-family: Arial" Width="525px" Font-Bold="True"></asp:Label><br /> <br /> <asp:Button ID="btnReturn" runat="server" Text="Return" /><br /> <br /> <asp:Label ID="lbltxtUserID" runat="server" Text="txtUserID" Visible="False"></asp:Label> <asp:TextBox ID="txtUserID" runat="server" Visible="False" Width="226px"></asp:TextBox><br /> <asp:Label ID="label4" runat="server" Text="TestModeOn" Visible="false"></asp:Label> <asp:TextBox ID="TestModeOn" runat="server" Visible="False" Width="226px"></asp:TextBox><br /> <br /> <asp:Label ID="lblSearchUserEntered" runat="server" Visible="false" Text="searchText" ></asp:Label> <asp:TextBox ID="searchText" runat="server" Visible="False" Width ="226px" ></asp:TextBox> <br /> <asp:Label ID="Label1" runat="server" Text="txtInstance_ID" Visible="False"></asp:Label> <asp:TextBox ID="txtInstance_ID" runat="server" Visible="False" Width="226px"></asp:TextBox><br /> <asp:Label ID="Label2" runat="server" Text="txtSeq_ID" Visible="False"></asp:Label> <asp:TextBox ID="txtSeq_ID" runat="server" Visible="False" Width="226px"></asp:TextBox><br /> <asp:Label ID="Label3" runat="server" Text="txtForm_Code" Visible="False"></asp:Label> <asp:TextBox ID="txtForm_Code" runat="server" Visible="False" Width="226px"></asp:TextBox><br /> <br /> <asp:Label ID="lblSince" runat="server" Visible="false" Text="Since" ></asp:Label> <asp:TextBox ID="SortSince" runat="server" Visible="False" Width ="226px" ></asp:TextBox> <br /> <br /> <asp:ObjectDataSource ID="odsA02_Tracking" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="A02WF01_AdminView" TypeName="WFA02DataObjects"> <SelectParameters> <asp:ControlParameter ControlID="txtUserID" Name="strUserID" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="TestModeOn" Name="strTestMode" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="searchText" Name="strSearchFieldValue" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="SortSince" Name="strDate" PropertyName="Text" Type="String" /> </SelectParameters> </asp:ObjectDataSource> </div> </form>

    Read the article

1