Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
199 views
Hello,

I want to allow the EnablePostBackOnRowClick only in some columns, is that possible?

Lets say I have a RadGrid with 5 Columns, is it possible to make only the 3 columns in the middle clickable and the first and last columsn not clickable?
I need this because I want to handle the "RowClick" event in ItemCommand but I don't want the RowCLick event to be triggered if I click on the row area of the first and last columns.

is it possible to do that?
Eyup
Telerik team
 answered on 06 Feb 2013
2 answers
101 views
How can I have the 'HTML' button selected when you go into edit mode for a GridHTMLEditorColumn?
Instead of the default of 'Design' being selected.

Thanks Darren


Darren
Top achievements
Rank 1
 answered on 06 Feb 2013
7 answers
189 views
Hi,

While using RadInputManager Text box, the value gets clear on Focusing. 


Thanks
Dhamodharan
Top achievements
Rank 1
 answered on 06 Feb 2013
1 answer
73 views
I believe the ASP.NET RadControls Grid is what i am looking for in order to display (programmatically) x level deep data.
I am wondering if this is possible and if so, how to do it?

I have a custom datasource in a List<T>
I want to be able to, programmatically, add header columns. Each headercolumn could be a simple bound column (non editable), or a checkbox (editable) or a dropdownlist (editable), or a button of somekind, so it would postback that row to the server (not using AJAX).. Is this possible? How?

furthermore, how can I, programmatically, add x level deep structure to a parent row? Similar to:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/detailtabledatabind/defaultcs.aspx

Kostadin
Telerik team
 answered on 06 Feb 2013
1 answer
81 views
Hi All,

After Added Chart ID to AjaxUpdatedControl I got an error:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

I already use to update a data grid with the same RadAjaxManager and everything works well with the grid!

Here the Ajax setting:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="GrabberMonitorGrid">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="StatisticsGrid"></telerik:AjaxUpdatedControl>
                <telerik:AjaxUpdatedControl ControlID="RadChart2"></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

Here the chart declaration:
<telerik:RadChart runat="server" Width="945" ID="RadChart2" Skin="LightBrown" Visible="false">
    <Appearance>
        <FillStyle MainColor="240, 237, 225"></FillStyle>
 
        <Border Color="209, 197, 175"></Border>
    </Appearance>
 
    <Series>
        <telerik:ChartSeries Name="Resieved Query" Type="SplineArea">
            <Appearance>
                <FillStyle FillType="ComplexGradient" MainColor="243, 206, 119">
                    <FillSettings>
                        <ComplexGradient>
                            <telerik:GradientElement Color="243, 206, 119" />
                            <telerik:GradientElement Color="236, 190, 82" Position="0.5" />
                            <telerik:GradientElement Color="210, 157, 44" Position="1" />
                        </ComplexGradient>
                    </FillSettings>
                </FillStyle>
                <TextAppearance TextProperties-Color="112, 93, 56">
                </TextAppearance>
                <Border Color="223, 170, 40" />
            </Appearance>
            <Items>
                <telerik:ChartSeriesItem YValue="1.2" XValue="0">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="3.2" XValue="1">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="2.2" XValue="2">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="5.2" XValue="3">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="4.2" XValue="4">
                </telerik:ChartSeriesItem>
            </Items>
        </telerik:ChartSeries>
 
        <telerik:ChartSeries Name="Recaived Result" Type="SplineArea">
            <Appearance>
                <FillStyle FillType="ComplexGradient" MainColor="154, 220, 230">
                    <FillSettings>
                        <ComplexGradient>
                            <telerik:GradientElement Color="154, 220, 230" />
                            <telerik:GradientElement Color="121, 207, 220" Position="0.5" />
                            <telerik:GradientElement Color="89, 185, 204" Position="1" />
                        </ComplexGradient>
                    </FillSettings>
                </FillStyle>
                <TextAppearance TextProperties-Color="112, 93, 56">
                </TextAppearance>
                <Border Color="117, 177, 192" />
            </Appearance>
            <Items>
                <telerik:ChartSeriesItem YValue="1.1" XValue="0">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="3.1" XValue="1">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="2.1" XValue="2">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="5.1" XValue="3">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="4.1" XValue="4">
                </telerik:ChartSeriesItem>
            </Items>
        </telerik:ChartSeries>
 
        <telerik:ChartSeries Name="Send Order" Type="SplineArea">
            <Appearance>
                <FillStyle FillType="ComplexGradient" MainColor="161, 218, 123">
                    <FillSettings>
                        <ComplexGradient>
                            <telerik:GradientElement Color="161, 218, 123" />
                            <telerik:GradientElement Color="130, 202, 82" Position="0.5" />
                            <telerik:GradientElement Color="104, 179, 48" Position="1" />
                        </ComplexGradient>
                    </FillSettings>
                </FillStyle>
                <TextAppearance TextProperties-Color="112, 93, 56">
                </TextAppearance>
                <Border Color="81, 162, 37" />
            </Appearance>
            <Items>
                <telerik:ChartSeriesItem YValue="1" XValue="0">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="3" XValue="1">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="2" XValue="2">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="5" XValue="3">
                </telerik:ChartSeriesItem>
                <telerik:ChartSeriesItem YValue="4" XValue="4">
                </telerik:ChartSeriesItem>
            </Items>
        </telerik:ChartSeries>
    </Series>
 
    <Legend>
        <Appearance Corners="Round, Round, Round, Round, 6">
            <ItemTextAppearance TextProperties-Color="113, 94, 57"></ItemTextAppearance>
 
            <Border Color="225, 217, 201"></Border>
        </Appearance>
    </Legend>
 
    <PlotArea>
        <XAxis LayoutMode="Normal" AutoScale="False" MaxValue="4" Step="1">
            <Appearance Color="226, 218, 202" MajorTick-Color="216, 207, 190">
                <MajorGridLines Color="226, 218, 202"></MajorGridLines>
 
                <TextAppearance TextProperties-Color="112, 93, 56"></TextAppearance>
            </Appearance>
 
            <AxisLabel>
                <TextBlock>
                    <Appearance TextProperties-Color="112, 93, 56"></Appearance>
                </TextBlock>
            </AxisLabel>
            <Items>
                 
                <telerik:ChartAxisItem Value="1"></telerik:ChartAxisItem>
                <telerik:ChartAxisItem Value="2"></telerik:ChartAxisItem>
                <telerik:ChartAxisItem Value="3"></telerik:ChartAxisItem>
                <telerik:ChartAxisItem Value="4"></telerik:ChartAxisItem>
            </Items>
        </XAxis>
 
        <YAxis>
            <Appearance Color="226, 218, 202" MinorTick-Color="226, 218, 202" MajorTick-Color="226, 218, 202">
                <MajorGridLines Color="231, 225, 212"></MajorGridLines>
                <MinorGridLines Color="231, 225, 212"></MinorGridLines>
                <TextAppearance TextProperties-Color="112, 93, 56"></TextAppearance>
            </Appearance>
 
            <AxisLabel>
                <TextBlock>
                    <Appearance TextProperties-Color="112, 93, 56"></Appearance>
                </TextBlock>
            </AxisLabel>
        </YAxis>
 
        <Appearance Dimensions-Margins="18%, 23%, 12%, 10%">
        <FillStyle MainColor="254, 255, 228" SecondColor="Transparent"></FillStyle>
 
        <Border Color="226, 218, 202"></Border>
        </Appearance>
    </PlotArea>
 
    <ChartTitle>
        <Appearance>
                <FillStyle MainColor=""></FillStyle>
        </Appearance>
 
        <TextBlock Text="Intelligent Labels - On">
            <Appearance TextProperties-Color="127, 85, 51"></Appearance>
        </TextBlock>
    </ChartTitle>
</telerik:RadChart>

Here the event execute grid:
<telerik:RadGrid ID="GrabberMonitorGrid" runat="server" OnDetailTableDataBind="InstrumentGrid_DatdataBind"
                        AutoGenerateColumns="False" AllowMultiRowSelection="false" AllowSorting="True"
                        OnItemCommand="RadGrid1_ItemCommand" ClientSettings-EnablePostBackOnRowClick="true"
                        CellSpacing="1" Skin="Office2010Silver">
 
Here the successfully updated grid:
<telerik:RadGrid ID="StatisticsGrid" runat="server" AllowSorting="True"
                        EnableLinqExpressions="False" MasterTableView-ShowHeadersWhenNoRecords="true"
                        OnDetailTableDataBind="StatisticsGrid_DatdataBind" Skin="Office2010Silver" CellSpacing="0"
                        GridLines="None">
                        <ClientSettings AllowKeyboardNavigation="false" Resizing-AllowColumnResize="True">
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="80%" />
                        </ClientSettings>

And here the C# code for updating the Chart:
#region Create chart series collection
             
            RadChart2.Chart.Series.Clear();
            for (int i = 0; i < interpolatedCounters.Length; i++)
            {
                InstrumentCountersUnit currentUnit = interpolatedCounters[i];
 
                foreach (string receivedCounterName in currentUnit.Received.Keys)
                {
                    Telerik.Charting.ChartSeries singleSeries = new ChartSeries(receivedCounterName, ChartSeriesType.SplineArea);
                    singleSeries.Name = "Recieved " + receivedCounterName;
 
                    SortedList<DateTime, int> counterValues = currentUnit.Received[receivedCounterName];
                    for (int j = 0; j < counterValues.Count; j++)
                    {
                        DateTime currentValueDate = counterValues.Keys[j];
                        int currentValueCounter = counterValues[currentValueDate];
                        ChartSeriesItem seriesItem = new ChartSeriesItem(currentValueCounter, currentValueDate.Minute);
                        singleSeries.AddItem(seriesItem);
                    }
                    RadChart2.Chart.Series.Add(singleSeries);
                }
 
                foreach (string sentCounterName in currentUnit.Sent.Keys)
                {
                    Telerik.Charting.ChartSeries singleSeries = new ChartSeries(sentCounterName, ChartSeriesType.SplineArea);
                    singleSeries.Name = "Sent " + sentCounterName;
                    SortedList<DateTime, int> counterValues = currentUnit.Sent[sentCounterName];
                    for (int j = 0; j < counterValues.Count; j++)
                    {
                        DateTime currentValueDate = counterValues.Keys[j];
                        int currentValueCounter = counterValues[currentValueDate];
                        ChartSeriesItem seriesItem = new ChartSeriesItem(currentValueCounter, currentValueDate.Minute);
                        singleSeries.AddItem(seriesItem);
                    }
                    RadChart2.Chart.Series.Add(singleSeries);
                }
 
                RadChart2.ChartTitle.TextBlock.Text = Name;
                RadChart2.Visible = true;
            }
             
            #endregion
Pavlina
Telerik team
 answered on 06 Feb 2013
9 answers
2.9K+ views
hello my dear friends:
i want to change the height of Radcombobox (Not the height of it's dropdown)...
for doing this i changed the height property of rad combobox but it changes the dropdown height...
before doing that i changed the font size of rad combobox and it looks like double layer...
for fix this i need to change the height of rad combobox (only it's text box)
thanks for your attention

Kate
Telerik team
 answered on 06 Feb 2013
7 answers
235 views
I am having a problem where the radeditor is setting all of the elements that do not have a font-size specifically applied to the element to 16px.  I have set the css file to 13px !important.  However that doesn't seem to work.  Attached is a screen shot of firebug showing that the computed font-szie is 16px but it shows the inherited font sizes as 13px.  If I just set the body font but don't style it with !important then it shows that the font size is overwritten but it doesn't show the style that is overwriting it. 
Rumen
Telerik team
 answered on 06 Feb 2013
3 answers
155 views

Hi All,

Is there a way to tell RadFilterNumericFieldEditor not to use thousands separator in its numeric editor? For example, I have columns that display Year or IDs. In the filter editor I want to see ‘2012’ and not ‘2,012’. For the column filters I did it with setting NumberFormat.GroupSeparator = "" on filteringItem, but cannot find a way to do it for RadFilter.

 
Thanks.
Elena.

Antonio Stoilkov
Telerik team
 answered on 06 Feb 2013
1 answer
166 views
Hi !

I have a RadTreeview to which I have set properties CheckBoxes="true"  and OnClientNodeChecking="ClientNodeChecking".

Now, at server-side RadTreeViewMain_NodeDataBound() event I am setting e.Node.Checkable = false; for all nodes.

Then I am checking e.Node.Category from database for each node and if node is of "Option" category, then I am setting e.Node.Checkable = true;

at client-side I have defined a javascript function which is used to uncheck all of the child nodes of the node on unchecking itself.

Surprisingly, it works fine fist time when I check the node and uncheck the same. But after that if I click the same node to make it checked, it shows it is already checked, while in UI it is not checked.

Javascript functions are as below :

function ClientNodeChecking(sender, eventArgs) {
    var node = eventArgs.get_node();
    var parent = node.get_parent();
    var t = node.get_treeView();
    var preventCheck = false;
    var isMultiSelect = parent.get_attributes().getAttribute("multiSelect");
    var allNodes = parent.get_allNodes();
    var value = node.get_value();
    var checkstate = node.get_checkState();
    var level = node.get_level();
    var errormessage = "";
 
    if (checkstate == 1) {
        t.trackChanges();
        node.uncheck();
        getAllChildUnchecked(node);
        t.commitChanges();
        return;
    }
 
    if (level > 2) {
        var grandParent = parent.get_parent();
        var grandParentCategory = grandParent.get_category();
 
        if (grandParentCategory == "Option" && !grandParent.get_checked()) {
 
            // you can add simple alert message here..
            //errormessage = "The parent node is not checked.";
            //openDialogPreventChecked(errormessage);
            eventArgs.set_cancel(true);
            return;
        }
    }
    if (allNodes.length > 0) {
        for (var i = 0; i < allNodes.length; i++) {
            var childnode = allNodes[i];
            var childvalue = childnode.get_value();
            if (childnode.get_checked() && isMultiSelect == "false" && value != childvalue) {
                preventCheck = true;
                break;
            }
        }
    }
    if (preventCheck) {
        // you can add simple alert message here..
        eventArgs.set_cancel(true);
        //errormessage = "This is not multi-select type of question";
        //openDialogPreventChecked(errormessage);
    }
}
 
function getAllChildUnchecked(node) {
    var childNodes = node.get_allNodes();
    if (childNodes.length > 0) {
        for (var i = 0; i < childNodes.length; i++) {
            var childnode = childNodes[i];
            childnode.uncheck();
            getAllChildUnchecked(childnode);
        }
    }
}


Kindly provide me some efficient solution. Awaiting for your valuable response.

Thanks,
Dev
Dev
Top achievements
Rank 1
 answered on 06 Feb 2013
1 answer
219 views
var isDoubleClick = false;
  
          var clickHandler = null;
  
          var ClikedDataKey = null;
  
          function RowClick(sender, args) {
              ClikedDataKey = args._dataKeyValues.ID;
  
              isDoubleClick = false;
  
              if (clickHandler) {
  
                  window.clearTimeout(clickHandler);
  
                  clickHandler = null;
  
              }
  
              clickHandler = window.setTimeout(ActualClick, 200);
  
          }
  
          function RowDblClick(sender, args) {
  
              isDoubleClick = true;
  
              if (clickHandler) {
  
                  window.clearTimeout(clickHandler);
  
                  clickHandler = null;
  
              }
  
              clickHandler = window.setTimeout(ActualClick, 200);
  
          }
  
          function ActualClick() {
  
              if (isDoubleClick) {
  
                  var grid = $find("<%=RadGrid1.ClientID %>");
                  if (grid) {
                      var MasterTable = grid.get_masterTableView();
                      var Rows = MasterTable.get_dataItems();
                      for (var i = 0; i < Rows.length; i++) {
                          var row = Rows[i];
                          if (ClikedDataKey != null && ClikedDataKey == row.getDataKeyValue("ID")) {
                              MasterTable.fireCommand("MyClick2", ClikedDataKey);
                          }
                      }
                  }
  
              }
  
              else {
  
                  var grid = $find("<%=RadGrid1.ClientID %>");
                  if (grid) {
                      var MasterTable = grid.get_masterTableView();
                      var Rows = MasterTable.get_dataItems();
                      for (var i = 0; i < Rows.length; i++) {
                          var row = Rows[i];
                          if (ClikedDataKey != null && ClikedDataKey == row.getDataKeyValue("ID")) {
                              MasterTable.fireCommand("MyClick1", ClikedDataKey);
                          }
                      }
                  }
  
              }
  
  
  
          }




protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "MyClick1")
        {
            // songle click
            //e.CommandArgument -- Get access datakey here
        }
        else if (e.CommandName == "MyClick2")
        {
            // Double click
            //e.CommandArgument -- Get access datakey here
        }
    }


<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" OnNeedDataSource="RadGrid1_NeedDataSource">
           <MasterTableView DataKeyNames="ID"
               ClientDataKeyNames="ID">
               <Columns>
                   ...................
                   ................
               </Columns>
           </MasterTableView>
           <ClientSettings>
               <ClientEvents OnRowDblClick="RowDblClick" OnRowClick="RowClick" />
           </ClientSettings>
       </telerik:RadGrid>







Here's the Problem:
Since I'm Firing the Command from CLIENT, in the server RadGrid1_ItemCommand
when I try to Access a Data Row Column 
via Hidden Field or just using

string STATUS= ((GridDataItem)e.Item).GetDataKeyValue("STATUS").ToString();

or the following

string STATUS= ((DataRowView)e.Item.DataItem)["STATUS"].ToString();

I always get the Value of the first Row, it does not get the value of the row that
was clicked, how do I get the value of the row that was

clicked considering i'm firing it form Client? Thank you.
Jayesh Goyani
Top achievements
Rank 2
 answered on 06 Feb 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?