Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
92 views
I have a RadGrid with a NestedViewTemplate shoving more details of the item as in this demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplatedeclarativerelations/defaultcs.aspx

I would like to extend this with the possibility to update the item and insert new item. Is this possible?

Anders
Eyup
Telerik team
 answered on 18 Jul 2013
1 answer
121 views
Hey Guys,

I have a RadGrid with a few Template Columns that is basically doing the same as the ButtonColumn, but I prefer to use the TemplateColumn type. When I click on the button inside this column, everything works as it should BUT NOT IN INTERNET EXPLORER 10. The error IE10 throws is this:

SCRIPT5022: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '

<!DOCTYPE html>'. 

When I switch my browser mode to Internet Explorer 9 (or earlier), then it works 100%. The problem is, we're using Telerik 2012.3.1308.40 and my client is using Internet Explorer 10, on Windows 8 (same as me). It is VITAL that the controls works in IE10. Any suggestions on why this error is happening?

The Grid layout:

<telerik:RadGrid ID="RadGridPolicies" runat="server" AllowSorting="true" DataSourceID="sqlPolicies" EnableEmbeddedSkins="false" Skin="DimsRed" OnItemCommand="RadGridPolicies_ItemCommand" OnItemDataBound="RadGridPolicies_ItemDataBound">
                        <ClientSettings EnableRowHoverStyle="true"></ClientSettings>
                        <MasterTableView AutoGenerateColumns="false" CellSpacing="-1" AllowPaging="false" DataKeyNames="groupID, groupName, groupIsActive" DataSourceID="sqlPolicies">
                            <Columns>
                                <telerik:GridBoundColumn DataField="groupID" HeaderText="groupID" UniqueName="groupID" SortExpression="groupID" Visible="false"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="groupName" HeaderText="Group Name" UniqueName="groupName" SortExpression="groupName"></telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn HeaderText="Status">
                                    <HeaderStyle Width="20px" HorizontalAlign="Center" />
                                    <ItemStyle Width="20px" HorizontalAlign="Center" />
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgStatusGroup" runat="server" ImageUrl="Images/imgNoCancel.png" CommandName="StatusGroup" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Configure">
                                    <HeaderStyle Width="20px" HorizontalAlign="Center" />
                                    <ItemStyle Width="20px" HorizontalAlign="Center" />
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgConfigureGroup" runat="server" ImageUrl="Images/imgConfigure.png" CommandName="ConfigureGroup" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Edit">
                                    <HeaderStyle Width="20px" HorizontalAlign="Center" />
                                    <ItemStyle Width="20px" HorizontalAlign="Center" />
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgEditGroup" runat="server" ImageUrl="Images/imgEdit.png" CommandName="EditGroup" OnClientClick="OpenPopup('ModalWindow');" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Purge">
                                    <HeaderStyle Width="20px" HorizontalAlign="Center" />
                                    <ItemStyle Width="20px" HorizontalAlign="Center" />
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgPurgeGroup" runat="server" ImageUrl="Images/imgDelete.png" CommandName="DeleteGroup" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>


The code behind:

protected void RadGridPolicies_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "StatusGroup")
        {
            int groupID = NecHelper.ParseInteger(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["groupID"].ToString());
            bool isActive = NecHelper.ParseBoolean(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["groupIsActive"].ToString());
            if (isActive)
                taPermissionGroups.UpdateGroupStatus(false, groupID);
            else
                taPermissionGroups.UpdateGroupStatus(true, groupID);
 
            RadGridPolicies.Rebind();
        }
        if (e.CommandName == "ConfigureGroup")
        {
            btnCreatePolicy.Style.Add("display", "none");
            hfCurrentPolicyID.Value = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["groupID"].ToString();
            lblActivePolicy.Style.Remove("display");
            lblActivePolicy.Text = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["groupName"].ToString();
            btnUpdatePolicy.Style.Remove("display");
            btnCancelPolicyEdit.Style.Remove("display");
 
            treeViewActive.Nodes.Clear();
            treeViewInactive.Nodes.Clear();
 
            PopulateViews(NecHelper.ParseInteger(hfCurrentPolicyID.Value));
        }
        if (e.CommandName == "EditGroup")
        {
            string groupID = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["groupID"].ToString();
            litModalTitle.Text = "Edit Permission Group";
 
            taPermissionGroups.FillByGroupID(ds.AccessPermissionGroups, NecHelper.ParseInteger(groupID));
            DataRow dr = ds.AccessPermissionGroups.Rows[0];
 
            txtGroupName.Text = dr["groupName"].ToString();
            txtGroupDescription.Text = dr["groupDescription"].ToString();
        }
        if (e.CommandName == "PurgeGroup")
        {
            int groupID = NecHelper.ParseInteger(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["groupID"].ToString());
            taPermissionGroups.PurgeGroup(true, groupID);
            RadGridPolicies.Rebind();
        }
    }
 
    protected void RadGridPolicies_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            ImageButton imgStatusGroup = (ImageButton)e.Item.FindControl("imgStatusGroup");
            bool isActive = NecHelper.ParseBoolean(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["groupIsActive"].ToString());
            if (isActive)
                imgStatusGroup.ImageUrl = "Images/imgYesOK.png";
        }
    }
Kostadin
Telerik team
 answered on 18 Jul 2013
4 answers
248 views
Hello,

how to expand/collapse one or several rows/colums in codebehind?

Thanks in advance!
Kostadin
Telerik team
 answered on 18 Jul 2013
1 answer
123 views
Is it possible to have the NumericTextBox control work ONLY with the buttons? To disallow typing in the TextBox portion?
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2013
3 answers
94 views
Hi

On uploading files the file name is rendered below the control. There can I add custom text along with the file name?

Thanks
Sameer
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2013
0 answers
122 views
hello sir

 I have Piechart with two series
my x values for both series is same but y values are diffrent

but when i assign them ,both the series are updated with values of series 2


For both series I am passing different values , but when i assign Datatable to RadChart2 it takes only values of series 2 and assign for both series

please help me
waiting for reply

 
<telerik:RadChart ID="RadChart2" runat="server" Height="400px" Visible ="false" Skin ="DeepBlue"
              Width="900px" OnItemDataBound="RadChart2_ItemDataBound" AutoLayout="true" AutoTextWrap="true" IntelligentLabelsEnabled ="true" >
      <Series>
            <telerik:ChartSeries Name="Cost_Of_Job" Type="Pie" DataYColumn="Count"  >
               <Appearance LegendDisplayMode="ItemLabels">
               </Appearance>
            </telerik:ChartSeries>
             
            <telerik:ChartSeries Name="Total_Invoice" Type="Pie" DataYColumn="Count" Visible ="false">
               <Appearance LegendDisplayMode="ItemLabels">
               </Appearance>
            </telerik:ChartSeries>
        </Series>
         
     </telerik:RadChart>

Protected Sub UpdateChart2(ByVal one As Double, ByVal two As Double, ByVal three As Double, ByVal four As Double, ByVal five As Double, ByVal six As Double, ByVal seven As Double, ByVal eight As Double, ByVal nine As Double)
 
       Try
           tblCostInvoiceheader.Visible = True
           tblCostInvoiceDetails.Visible = True
           RadChart2.ChartTitle.TextBlock.Text = cbChartBy.Text
           Dim salesSeries As ChartSeries = RadChart2.GetSeries("Cost_Of_Job")
           Dim InvoiceSeries As ChartSeries = RadChart2.GetSeries("Total_Invoice")
           InvoiceSeries.Visible = False
           InvoiceRow.Visible = False
 
 
 
           Dim Total As Double = 0
           Dim one1 As Double = one
           Dim two1 As Double = two
           Dim three1 As Double = three
           Dim four1 As Double = four
           Dim five1 As Double = five
           Dim six1 As Double = six
           Dim seven1 As Double = seven
           Dim eight1 As Double = eight
           Dim nine1 As Double = nine
 
 
           Total = (one + two + three + four + five + six + seven + eight + nine)
 
           one1 = ((one / Total) * 100)
           two1 = ((two / Total) * 100)
           three1 = ((three / Total) * 100)
           four1 = ((four / Total) * 100)
           five1 = ((five / Total) * 100)
           six1 = ((six / Total) * 100)
           seven1 = ((seven / Total) * 100)
           eight1 = ((eight / Total) * 100)
           nine1 = ((nine / Total) * 100)
 
          
           Dim dt As New DataTable
           dt.Columns.Add("Invoice")
           dt.Columns.Add("Count")
           dt.Rows.Add(cbInvoiceStatus.Items(0).Text, one1)
           dt.Rows.Add(cbInvoiceStatus.Items(1).Text, two1)
           dt.Rows.Add(cbInvoiceStatus.Items(2).Text, three1)
           dt.Rows.Add(cbInvoiceStatus.Items(3).Text, four1)
           dt.Rows.Add(cbInvoiceStatus.Items(4).Text, five1)
           dt.Rows.Add(cbInvoiceStatus.Items(5).Text, six1)
           dt.Rows.Add(cbInvoiceStatus.Items(6).Text, seven1)
           dt.Rows.Add(cbInvoiceStatus.Items(7).Text, eight1)
           dt.Rows.Add(cbInvoiceStatus.Items(8).Text, nine1)
 
           RadChart2.Series(0).DataYColumn = "Count"
           RadChart2.DataSource = dt
           RadChart2.DataBind()
 
 
           txtBillable.Text = one
           txtBillableST.Text = two
           txtStartUp.Text = three
           txtStartupST.Text = four
           txtTraningService.Text = five
           txtTrainingSTService.Text = six
           txtWarranty.Text = seven
           txtWarrantyST.Text = eight
           txtUnspecifiedCost.Text = nine
 
 
           'if Invoice vs Cost
 
           If cbChartBy.Text = "Invoice vs Cost" Then
 
               Call CostVSInvoice()
               InvoiceRow.Visible = True
               InvoiceSeries.Visible = True
 
               Dim Total1 As Double = 0
               Dim one2 As Double = 0
               Dim two2 As Double = 0
               Dim three2 As Double = 0
               Dim four2 As Double = 0
               Dim five2 As Double = 0
               Dim six2 As Double = 0
               Dim seven2 As Double = 0
               Dim eight2 As Double = 0
               Dim nine2 As Double = 0
 
 
               Total1 = (CountInvBillable + CountInvBillableST + CountInvStartUp + CountInvStartUpST + CountInvTrainingService + CountInvTrainingSTService + CountInvWarranty + CountInvWarrantyST + CountInvCost)
 
               one2 = ((CountInvBillable / Total1) * 100)
               two2 = ((CountInvBillableST / Total1) * 100)
               three2 = ((CountInvStartUp / Total1) * 100)
               four2 = ((CountInvStartUpST / Total1) * 100)
               five2 = ((CountInvTrainingService / Total1) * 100)
               six2 = ((CountInvTrainingSTService / Total1) * 100)
               seven2 = ((CountInvWarranty / Total1) * 100)
               eight2 = ((CountInvWarrantyST / Total1) * 100)
               nine2 = ((CountInvCost / Total1) * 100)
 
             

               Dim dt1 As New DataTable
               dt1.Columns.Add("Invoice")
               dt1.Columns.Add("Count")
               dt1.Rows.Add(cbInvoiceStatus.Items(0).Text, one2)
               dt1.Rows.Add(cbInvoiceStatus.Items(1).Text, two2)
               dt1.Rows.Add(cbInvoiceStatus.Items(2).Text, three2)
               dt1.Rows.Add(cbInvoiceStatus.Items(3).Text, four2)
               dt1.Rows.Add(cbInvoiceStatus.Items(4).Text, five2)
               dt1.Rows.Add(cbInvoiceStatus.Items(5).Text, six2)
               dt1.Rows.Add(cbInvoiceStatus.Items(6).Text, seven2)
               dt1.Rows.Add(cbInvoiceStatus.Items(7).Text, eight2)
               dt1.Rows.Add(cbInvoiceStatus.Items(8).Text, nine2)
 
               RadChart2.Series(1).DataXColumn = "Count"
               RadChart2.DataSource = dt1
               RadChart2.DataBind()
 
 
               txtInvBillable.Text = CountInvBillable
               txtInvBillableST.Text = CountInvBillableST
               txtInvStartUp.Text = CountInvStartUp
               txtInvStartUpST.Text = CountInvStartUpST
               txtInvTrainingService.Text = CountInvTrainingService
               txtInvTrainingSTService.Text = CountInvTrainingSTService
               txtInvWarranty.Text = CountInvWarranty
               txtInvWarrantyST.Text = CountInvWarrantyST
               txtUnspecifiedInvoice.Text = CountInvCost
 
           End If
 
       Catch ex As Exception
           RadWindowManagerchartbyInvoice.RadAlert(Replace(ex.Message.ToString, "'", "\'"), 380, 100, "Error-UpdateChart2", "")
       End Try
 
   End Sub



             
Kishor
Top achievements
Rank 2
 asked on 18 Jul 2013
4 answers
190 views
I want to use the RadGrid for user to do data entry
inside the grid, there was a few of RadComboBox, RadNumericTextBox for edit.

i want to use the Add Row Button outside the grid, i use the following methods and it did not work
1) i have try add new row on the datatable and rebind grid
2) RadGrid1.MasterTableView.IsItemInserted = True

i want to know if the grid can do a multi row edit, where user can select any item to edit without the needs to click the Edit and Update button on the grid, and click the Submit button out of the grid the save the data.

i face a problem on data binding the grid, and it is saying System.ArgumentException: Grid Data Source Error :Column 'invBCItm_guid' does not belong to table .
i having the column in the datatable and the ASPX

 i am newbie to telerik, i need some information & guides on this.
S L
Top achievements
Rank 1
 answered on 18 Jul 2013
1 answer
1.1K+ views
Hi,
  
I have datakeyname value. I need to get a row using this key value out of Radgrid events. All the code
is in Radgrid events. Out of Radgrid events means, they suggest to loop thru
Rows and get a row like this:
  
Foreach (GridDataItem row in Radgrid1.Items)
{
    If (row.GetDataKeyValue(“ID”).ToString() == “100”)
               Row.Remove;
}
  
One more thing is that when that particular row is found, I need to delete it from grid.
But GridDatItem (row) doesn’t have delete or remove method. It has only dispose. I don’t think dispose
does the job of delete. I don’t want grid to be rebound after deleting row.
  
Please suggest how to do it. We are not using needsource event to bind grid. Our architecture will not
suit to use it. So, we bind the grid where ever necessary. I need to have this code for our page to work.
  
Thanks,
Prathiba.
Jayesh Goyani
Top achievements
Rank 2
 answered on 18 Jul 2013
1 answer
208 views
Hi guys

I am trying to convert the selected time in radtimepicker to am/pm format using the following code.

string start = RadTimePickerstartschedule.SelectedTime.ToString("hh:mm:tt");

but I am getting an error that there is no ToString() that takes 1 argument.
Actually the radtimepicker displays date in am/pm format but when I checked in C# code, its automatically converted to 24 clock format. How can I convert the time to am/pm format?

Please help soon
Antony
A2H
Top achievements
Rank 1
 answered on 18 Jul 2013
1 answer
157 views
Hi

Using CSS styles, how can I set a custom color to selected item background?

Thanks,
Damian.
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?