Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
563 views
Hi,

I am using a RadGrid with DetailTables.
I am using inline editing for each of my DetailTables.
I am able to perform Insert/Update operations. However, after the inert or update operation when I call Rebind on the RadGrid, I get the folowing error : There was a problem extracting DataKeyValues from the DataSource.
This message is displayed in Visual Studio in the catch block. However on the error page it says "

COLUMN_NAME is neither a DataColumn nor a DataRelation for table Table.

". I have data in my table. This error does not show up when the page loads normally. It only shows up when the Insert/Update event for the RadGrids DetailTable is fired.

Could someone provide a solution and tell me the reason why this is happening.

Thanks,
Roman
Top achievements
Rank 1
 answered on 14 Mar 2017
11 answers
1.2K+ views
Hello Dears,

I am facing an issue.

After upgrading from telerik v2009  to  telerk v2012 , I can't get my selected rows values in a radgrid with checkboxes from code behind

here is the code in the markup
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"
                          PageSize="5"     Width="100%"    OnPageIndexChanged="RadGrid1_PageIndexChanged"
                            GridLines="None" Skin="Vista" AllowMultiRowSelection="True"  >
                            <MasterTableView >
                            <Columns>
                                <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" ></telerik:GridClientSelectColumn>
                            </Columns>
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <PagerStyle Mode="NextPrev" />
                            </MasterTableView>
                            <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False"
                                Font-Strikeout="False" Font-Underline="False" Wrap="True" />
                            <ClientSettings EnableRowHoverStyle="true"  >
                                <Selecting AllowRowSelect="True" UseClientSelectColumnOnly "true"   />
                            </ClientSettings>
                        </telerik:RadGrid>
and now the code behind

 protected void  Ok_Click(object sender, System.EventArgs e)
        {
foreach (GridDataItem item in RadGrid1.SelectedItems)
               {
                   CheckBox chk = (CheckBox)item["ClientSelectColumn"].Controls[0];
                   id = item["ID"].Text; // get the id with its column name
                   name = item["NAME"].Text; // get the name with its column name
                   chec = chk.Checked;
 
 
               }
}

It doesn't even enter in the loop.
What can I do to resolve it ?

Thank in advance for your assistance
yook
Top achievements
Rank 1
 answered on 14 Mar 2017
3 answers
1.3K+ views
Hi everybody, as my title says, i have a GridClientSelectColumn, on my radGrid, and a button outside this grid, in this button, i try to get all checked check box on this way:
protected void btnDel_Click(object sender, EventArgs e)
{
    string id;
    bool chec;
    foreach (GridDataItem item in RadGrid2.Items)
    {
        CheckBox chk = (CheckBox)item["CheckboxColumn"].Controls[0];
        id = item["codigo"].Text;
        chec= chk.Checked;
    }
}

but if i try this way, i will get one by one valuee from checkbox that are checked.
Exist some way to get ALL rows that my gridClient are selected?
Thankz in advance

<telerik:RadGrid ID="RadGrid2" runat="server" AllowMultiRowSelection="true" Width="300px"
              OnNeedDataSource="RadGrid2_NeedDataSource">
              <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Novo Registro"
                  CommandItemSettings-RefreshText="Atualizar" DataKeyNames="codigo">
                  <Columns>
                      <telerik:GridClientSelectColumn UniqueName="CheckboxColumn" />
                      <telerik:GridBoundColumn HeaderText="Código" DataField="codigo" UniqueName="codigo" />
                      <telerik:GridBoundColumn HeaderText="Descrição" DataField="descricao" UniqueName="descricao" />
                  </Columns>
              </MasterTableView>
              <ClientSettings EnablePostBackOnRowClick="True">
                  <Selecting AllowRowSelect="true" />
              </ClientSettings>
          </telerik:RadGrid>
      <asp:Button ID="btnDeletar" CommandName="Delete" runat="server"
          Text="Deletar Items" onclick="btnDeletar_Click" />
yook
Top achievements
Rank 1
 answered on 14 Mar 2017
1 answer
103 views
Hi,

Is it possible to load an XML content as string to Editor ToolsFile instead of the XML file path? 
Rumen
Telerik team
 answered on 13 Mar 2017
2 answers
194 views

You may see it on the official  : http://demos.telerik.com/aspnet-ajax/button/examples/rendermode/defaultcs.aspx?skin=Black

Checkboxes and Radio are not properly visualized in the Classic Rendering mode.

The issue is reproduced with any browser.

Marin Bratanov
Telerik team
 answered on 13 Mar 2017
9 answers
441 views
Hi,
     I want to show an ajax loader processing icon when i click the drop down button of a Rad Combobox and it should be hidden when the drop down items are displayed. I tried doing with the onclientdropdownopening and onclientdwnopened ropdoproperties of the combobox but still I was not able to get the desired results. Can anyone help me out with this???
Arun
Top achievements
Rank 1
 answered on 13 Mar 2017
0 answers
147 views
I have few RadComboBox on asp.net Page, all Dropdown are being expading, except that one which i placed at the bottom of the page. When i place that last Dropdown on upper part of asp page then works fine, but not working at bottom. Please suggest.
Ameer
Top achievements
Rank 1
 asked on 12 Mar 2017
0 answers
66 views
hi when i export a grid with groups to excel footers dont show. Please help me to show footers in excel
maedeh
Top achievements
Rank 1
 asked on 12 Mar 2017
3 answers
726 views
Well I am trying to change the tab heading titles programmatically at runtime...just trying out the trial version...I am new...so please don't mind my ignorance...I tried to search but in vain.Everytime I tried to change the text property of the radtab from code behind...I end up with an object null reference error...lemme tell you what I tried...I need to know as to how do we set the title of a tab at runtime without ending up with an "Object reference not set to an instance of an object." error.


public partial class JobseekerHome : BasePage 
    #region RadStripBar 
    protected override void Page_Load(object sender, System.EventArgs e) 
    { 
        if (!Page.IsPostBack) 
        { 
            AddTab("LanguageUC""Mini profile"); 
            AddPageView(RadTabStrip1.FindTabByText("LanguageUC")); 
            AddTab("OrdersCS""Experience"); 
            AddTab("ProjectUC""Experience"); 
        } 
    } 
 
    private void AddTab(string tabValue, string tabName) 
    { 
        RadTab tab = new RadTab(); 
        tab.Text = tabValue; 
        tab.Value = tabName; 
        RadTabStrip1.Tabs.Add(tab); 
    } 
 
    protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e) 
    { 
        string userControlName = e.PageView.ID + ".ascx"
 
        Control userControl = Page.LoadControl(userControlName); 
        userControl.ID = e.PageView.ID + "_userControl"
 
        e.PageView.Controls.Add(userControl); 
        e.PageView.FindControl(RadTabStrip1.FindTabByText("LanguageUC").Text="Language"); 
        e.PageView.FindControl(RadTabStrip1.FindTabByText("OrdersCS").Text = "Orders"); 
    } 
 
    private void AddPageView(RadTab tab) 
    { 
        RadPageView pageView = new RadPageView(); 
        pageView.ID = tab.Text; 
        RadMultiPage1.PageViews.Add(pageView); 
        pageView.CssClass = "pageView"
        tab.PageViewID = pageView.ID; 
    } 
 
    protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e) 
    { 
        AddPageView(e.Tab); 
        e.Tab.PageView.Selected = true
    } 
    #endregion 

Alfonso
Top achievements
Rank 1
 answered on 12 Mar 2017
0 answers
180 views

I'm trying to replicate the behaviour in the attached series of jpgs. ( was going to be avideo but can't attach it ). If a user just clicks on a grid row then the row should highlight and an indicator should appear to the left of the grid. If the user actually clicks the check box the row is highlighted, has the indicator and the check box is ticked. There should also be a check box in the grid header to select all rows and show them as ticked or to reset all check boxes back to empty if it is itself ticked. The last clicked row should retain the indicator.

I thought i could use a GridClientSelectColumn to do this but it's behaviour is not quite what I want to replicate.

The application whose functionality i'm trying to replicate uses CSS to overwrite the different check box symbols. It has 4 images, 1 with an empty tick box, 1 with an empty tick box and the indicator, 1 with a ticked box and 1 with ticked box and indicator. I tried to do this by using a GridButtonColumn but that doen't put a button into the header row.

I have a sample app where I'm trying various method but again a can't attach it to the post so here's the code for my grid...

                    <telerik:RadGrid ID="rgProducts" runat="server" Width="100%" AllowMultiRowSelection="true"
                        AllowSorting="true" RenderMode="Lightweight" CssClass="RadGrid_RoundCorners" Skin="Max2017" EnableEmbeddedSkins="false"
                        OnNeedDataSource="rgProducts_NeedDataSource" OnItemCreated="rgProducts_ItemCreated" OnItemDataBound="rgProducts_ItemDataBound"
                        OnUpdateCommand="rgProducts_UpdateCommand" OnInsertCommand="rgProducts_InsertCommand" OnDeleteCommand="rgProducts_DeleteCommand"
                        OnItemCommand="rgProducts_ItemCommand">

                        <MasterTableView DataKeyNames="Product_Id" ClientDataKeyNames="Product_Id" AllowMultiColumnSorting="true" AutoGenerateColumns="false" CommandItemDisplay="Top" >

                            <Columns>
                                <telerik:GridBoundColumn DataField="Product_Id" UniqueName="ProductId" Display="false">
                                </telerik:GridBoundColumn>

                                <telerik:GridClientSelectColumn UniqueName="rgProductSelectCol">
                                    <HeaderStyle Width="30px" />
                                </telerik:GridClientSelectColumn>

                                <telerik:GridImageColumn UniqueName="gic" >
                                    <HeaderStyle CssClass="row_selector" Width="32px" />
                                    <ItemStyle CssClass="row_selector" />
                                </telerik:GridImageColumn>

                                <telerik:GridButtonColumn ButtonType="ImageButton" ButtonCssClass="row_selector" Resizable="false" UniqueName="freddy"
                                    CommandName="gbc" HeaderImageUrl="/images/ico_entry_unchecked.png">
                                    <HeaderStyle Width="32px" />
                                </telerik:GridButtonColumn>

                                <telerik:GridBoundColumn DataField="Product_Code" HeaderText="Product Code" SortExpression="Product_Code"
                                    UniqueName="ProductCode">
                                    <HeaderStyle Width="12%" Font-Bold="true" />
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn DataField="Product_Description" HeaderText="Product Description" SortExpression="Product_Description"
                                    UniqueName="ProductDescription">
                                    <HeaderStyle Width="30%" Font-Bold="true" />
                                </telerik:GridBoundColumn>

                                <telerik:GridNumericColumn DataField="Unit_Sell" HeaderText="Unit Sell" SortExpression="Unit_Sell"
                                    UniqueName="UnitSell" DataType="System.Double" DataFormatString="{0:#,##0.00}">
                                    <HeaderStyle Width="7%" HorizontalAlign="Right" Font-Bold="true" />
                                    <ItemStyle HorizontalAlign="Right" />
                                </telerik:GridNumericColumn>

                                <telerik:GridNumericColumn DataField="Unit_Cost" HeaderText="Unit Cost" SortExpression="Unit_Cost"
                                    UniqueName="UnitCost" DataType="System.Double" DataFormatString="{0:#,##0.00}">
                                    <HeaderStyle Width="7%" HorizontalAlign="Right" Font-Bold="true" />
                                    <ItemStyle HorizontalAlign="Right" />
                                </telerik:GridNumericColumn>

                                <telerik:GridNumericColumn DataField="Renewal_Cost" HeaderText="Renewal Cost" SortExpression="Renewal_Cost"
                                    UniqueName="RenewalCost" DataType="System.Double" DataFormatString="{0:#,##0.00}">
                                    <HeaderStyle Width="9%" HorizontalAlign="Right" Font-Bold="true" />
                                    <ItemStyle HorizontalAlign="Right" />
                                </telerik:GridNumericColumn>

                                <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments" SortExpression="Comments"
                                    UniqueName="Comments">
                                    <HeaderStyle  Font-Bold="true" />
                                </telerik:GridBoundColumn>
                            </Columns>

                        </MasterTableView>

                        <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true" >
                            <Selecting AllowRowSelect="true" />
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="100%" />
                            <%--<ClientEvents OnRowContextMenu="RowContextMenu" OnGridCreated="GridCreated" OnRowClick="GridRowClicked" />--%>
                            <ClientEvents OnGridCreated="GridCreated" OnRowClick="GridRowClicked" />
                        </ClientSettings>

                    </telerik:RadGrid>

And my CSS for the images ...

            .mainSelector{ cursor:pointer; width : 24px; float: left; clear: left; margin-top:2px; padding:0px; padding-top:2px; padding-bottom:2px; position:absolute; }
            .mainSelectorChecked{ width : 24px; float: left; clear: left; margin-top:2px; padding:0px; padding-top:2px; padding-bottom:2px; background-image:url(../images/ico_entry_checked.png); background-repeat:no-repeat; }
            .mainSelectorUnChecked { width : 24px; float: left; clear: left; margin-top:2px; padding:0px; padding-top:2px; padding-bottom:2px; background-image:url(../images/ico_entry_unchecked.png); background-repeat:no-repeat; }
                      
            .row_selector { background-image: url("../images/ico_entry_unchecked.png"); background-position: center 6px; background-repeat: no-repeat; clear: left; float: left; min-height: 18px; padding-top: 4px; width: 16px; }
            .row_selectorCurrent { }
            .row_selectorCurrentChecked { background-image: url("../images/ico_currrentEntry_checked.png"); }
            .row_selectorCurrentUnChecked { background-image: url("../images/ico_currrentEntry_unchecked.png"); }
            .row_selectorChecked { background-image: url("../images/ico_entry_checked.png"); }
            .row_selectorSelected { }

Has anyone any ideas how i might achieve this ?

CP
Top achievements
Rank 1
Iron
 asked on 10 Mar 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?