Accessing Grid Column Values on server side when grid is bind on client side

3 posts, 0 answers
  1. Brendom
    Brendom avatar
    2 posts
    Member since:
    Oct 2015

    Posted 07 Oct 2015 Link to this post

     This is my RadGrid which i have bind from json on client side javascript but i want to access this grid values on server side in my code behind file.
     
    <telerik:RadGrid ID="radGridView2" runat="server" AllowSorting="True"<br>            OnNeedDataSource="radGridView2_NeedDataSource"<br>            Width="800px" GroupPanelPosition="Top" <br>             ResolvedRenderMode="Classic" <br>            Height="35em" Enabled="False"><br>             <ClientSettings><br>                    <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling><br>                    <Selecting AllowRowSelect="True" /><br>                    <ClientEvents OnRowSelected="RowSelected" /><br>                </ClientSettings><br>                <br>                 <SelectedItemStyle BorderStyle="Dashed"<br>                    BorderWidth="1px"/><br>       <MasterTableView AutoGenerateColumns="False"><br>    <Columns><br>      <telerik:GridBoundColumn  DataField="SNO" UniqueName="SNO" HeaderText="SN#"><br>      <HeaderStyle Width="10px"/><br>      </telerik:GridBoundColumn><br>       <telerik:GridBoundColumn DataField="INITIAL" UniqueName="INITIAL" HeaderText="TYPE"><br>       <HeaderStyle Width="10px"/><br>      </telerik:GridBoundColumn><br>       <telerik:GridBoundColumn DataField="TITLE" UniqueName="TITLE" HeaderText="ACCOUNT TITLE"><br>      <HeaderStyle Width="80px"/><br>      </telerik:GridBoundColumn><br>      <telerik:GridBoundColumn DataField="DISC" UniqueName="DISC" HeaderText="DESCRIPTION" Resizable="False"><br>      <HeaderStyle Width="160px"/><br>      </telerik:GridBoundColumn><br>       <telerik:GridBoundColumn DataField="JOB" UniqueName="JOB" HeaderText="COST CENTER"><br>      <HeaderStyle Width="55px"/><br>      </telerik:GridBoundColumn><br>       <telerik:GridBoundColumn DataField="dRR" UniqueName="dRR" HeaderText="DEBIT" DataFormatString="{0:N}"><br>    <HeaderStyle Width="35px"/><br>      </telerik:GridBoundColumn><br>       <telerik:GridBoundColumn DataField="cRR" UniqueName="cRR" HeaderText="CREDIT" DataFormatString="{0:N}"><br>      <HeaderStyle Width="35px"/><br>      </telerik:GridBoundColumn><br>      <telerik:GridBoundColumn DataField="acno" UniqueName="acno" HeaderText="acno" Visible="false" ><br>      <HeaderStyle Width="35px"/><br>      </telerik:GridBoundColumn><br>        <telerik:GridBoundColumn DataField="job_id" UniqueName="job_id" HeaderText="job_id" Visible="false" ><br>      <HeaderStyle Width="35px"/><br>      </telerik:GridBoundColumn><br>           <telerik:GridBoundColumn DataField="U_INSERT" UniqueName="U_INSERT" HeaderText="U_INSERT" Visible="false" ><br>      <HeaderStyle Width="35px"/><br>      </telerik:GridBoundColumn><br>        <telerik:GridBoundColumn DataField="I_DATE" UniqueName="I_DATE" HeaderText="I_DATE" Visible="false" ><br>      <HeaderStyle Width="35px"/><br>      </telerik:GridBoundColumn><br>    </Columns><br>  </MasterTableView><br>  <ClientSettings><br>    <ClientEvents OnCommand="function(){}" /><br>  </ClientSettings><br>        <ItemStyle BorderStyle="Ridge" /><br>        </telerik:RadGrid>  <br>

     

    This is how i am accessing my RadGrid

     

    <p style=" background-color: #fff;"><font color="#000000" face="monospace"> foreach (GridDataItem item in radGridView2.Items)<br>                {<br>                    string idd1 = item["acno"].Text.Trim();<br>                    string type = item["INITIAL"].Text.Trim();<br>                    string jbid = item["job_id"].Text.Trim();<br>                    string disc = item["DISC"].Text.Trim();<br>                    string dRR1 = item["dRR"].Text.Trim().Replace(",", "");<br>                    string cRR1 = item["cRR"].Text.Trim().Replace(",", "");<br>                    string un1 = item["U_INSERT"].Text.Trim();</font></p><p style=" background-color: #fff;"><font color="#000000" face="monospace">}​</font></p>
     foreach (GridDataItem item in radGridView2.Items)
                    {
                        string idd1 = item["acno"].Text.Trim();
                        string type = item["INITIAL"].Text.Trim();
                        string jbid = item["job_id"].Text.Trim();
                        string disc = item["DISC"].Text.Trim();
                        string dRR1 = item["dRR"].Text.Trim().Replace(",", "");
                        string cRR1 = item["cRR"].Text.Trim().Replace(",", "");
                        string un1 = item["U_INSERT"].Text.Trim();

    }

    But the columns are coming " &nbsp; " What i am doing wrong here ?

  2. Brendom
    Brendom avatar
    2 posts
    Member since:
    Oct 2015

    Posted 07 Oct 2015 in reply to Brendom Link to this post

    Come on anyone answer ? Or give me some type of sort or suggestion
  3. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 12 Oct 2015 Link to this post

    Hi Brendom,

    I am afraid that you cannot access the values on the server when using a client-side binding. Nevertheless, you can access them on the client by using the client API.

    Regards,
    Kostadin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top