Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
145 views

Hi,

I would like to be able to change the RadioButtonList border color depending on certain conditions from JS.

Here I am looping through all the Rad radio controls and on certain conditions I would like to change the border style for the RadioButtonList.


  var allRadControls = $telerik.radControls;
            var Found = false;       
            for (var i = 0; i < allRadControls.length; i++) {
                var element = allRadControls[i];
                //text Radio
                if (Telerik.Web.UI.RadRadioButtonList && Telerik.Web.UI.RadRadioButtonList.isInstanceOfType(element)) {
                    var items = element.get_items();
                    var x = element.get_element().parentElement;
                  
                  //  alert(pageview.findControl(element).get_id());

                    if (element.get_toolTip() == 'y' &&
                        x.id == pageview.get_id() &&
                        element.get_selectedIndex() <= 0) {
                        element.style.color = 'white';
                        
                        return 'y'
                    }
                    else {
                        Found= 'n'
                    }
                 
                }
            }
            return Found;

I appreciate the help.

Thanks,.

Omar

 

 

 

Vasko
Telerik team
 answered on 01 Nov 2023
1 answer
197 views

Hi,

I would like to get the selected row index for the grouped grid. Can anyone help me with this?

 


<telerik:RadGrid ID="Grid_logic" runat="server" AutoGenerateColumns="false" Font-Size="Small" Width="600px" Skin="Default" ShowGroupPanel="false" OnSelectedIndexChanged="Grid_logic_SelectedIndexChanged">
    <GroupingSettings CollapseAllTooltip="Collapse all groups"  />
       <MasterTableView ClientDataKeyNames="logicID"  DataKeyNames="logicID"  ShowGroupFooter="false" ShowHeader="false" GroupsDefaultExpanded="true" GroupLoadMode="Client">
          <Columns>
                                                    
            <telerik:GridBoundColumn DataField="logicID" FilterControlAltText="Filter column column" HeaderText="" UniqueName="logicID"  Visible="true" >
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Answer" FilterControlAltText="Filter column column" HeaderText="Answer" UniqueName="Answer">
            </telerik:GridBoundColumn>
           <telerik:GridBoundColumn DataField="IncludedPages" FilterControlAltText="Filter column column" HeaderText="Included Pages" UniqueName="IncludedPages">
           </telerik:GridBoundColumn>
        </Columns>

         <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <SelectFields>
                     <telerik:GridGroupByField FieldAlias="Answer" FieldName="Answer" HeaderText="" />
                     <telerik:GridGroupByField FieldName="IncludedPages" HeaderText="IncludedPages" />
                </SelectFields>
      <GroupByFields>
        <telerik:GridGroupByField FieldAlias="Page" FieldName="Page" FormatString="" HeaderText="" />
       <telerik:GridGroupByField FieldAlias="Question" FieldName="Question" FormatString="" HeaderText="" />
     </GroupByFields>
  </telerik:GridGroupByExpression>
 </GroupByExpressions>
 <GroupHeaderTemplate>
    <table>
        <tr style="width: 100%">
        <td style="vertical-align: central">
        <asp:Label ID="Page" runat="server" Text='<%# Eval("Page") %>' ></asp:Label>
       </td>
     <td style="vertical-align: central">
     <asp:Label ID="Question" runat="server" Text='<%# Eval("Question") %>'></asp:Label>
      </td>
    </tr>
  </table>
  </GroupHeaderTemplate>
 </MasterTableView>
                                            
 <ClientSettings AllowDragToGroup="true" >
 <Selecting AllowRowSelect="true"></Selecting>
 <ClientEvents OnRowContextMenu="RowContextMenu" />
 </ClientSettings>
</telerik:RadGrid>

 

An example of my field attempts.


protected void Grid_logic_SelectedIndexChanged(object sender, EventArgs e)
        {
            int x = Grid_logic.SelectedItems.Count;
            if (Grid_logic.SelectedItems.Count > 0 && Grid_logic.SelectedItems[0].OwnerTableView.DataKeyValues.Count > 0)
            {
                var z = Grid_logic.SelectedItems[0].OwnerTableView.DataKeyValues[Grid_logic.SelectedItems[0].ItemIndex]["logicID"];
            }
        }

Thanks,

 

Attila Antal
Telerik team
 updated answer on 01 Nov 2023
1 answer
89 views

I am using RadScheduler with TimeLineView Only, GroupBy Resource with GroupDirection set Vertical.

I set the object height to 585px, but when rendered, it only shows 360px, as you can see in the image.

What can I do to work around this situation without changing the rowHeight property?

I am using server-side binding but if I change to client-side binding, can I solve this problem modifying Client Rendering?

Attila Antal
Telerik team
 answered on 01 Nov 2023
1 answer
121 views

Hi,

I am trying to run the example https://docs.telerik.com/devtools/aspnet-ajax/controls/diagram/server-side-programming

But the output is as shown in the attached picture.

Can anyone inform me what I am missing?

 


 protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //RadDiagram2.Visible = true;
            //RadDiagram2.DataSource = GetShapes();
            //RadDiagram2.ConnectionDataSource = GetConnections();
            //RadDiagram2.DataBind();
        }

        RadDiagram RadDiagram1 = new RadDiagram();

        // General diagram settings
        RadDiagram1.Width = 800;
        RadDiagram1.Height = 600;
        RadDiagram1.ShapeDefaultsSettings.Width = 140;
        RadDiagram1.ShapeDefaultsSettings.Height = 30;
        RadDiagram1.ShapeDefaultsSettings.StrokeSettings.Color = "#fff";
        Form.Controls.Add(RadDiagram1);

        // Layout settings
        RadDiagram1.LayoutSettings.Enabled = true;
        RadDiagram1.LayoutSettings.Type = Telerik.Web.UI.Diagram.LayoutType.Layered;
        RadDiagram1.LayoutSettings.Subtype = Telerik.Web.UI.Diagram.LayoutSubtype.Right;
        RadDiagram1.LayoutSettings.VerticalSeparation = 20;
        RadDiagram1.LayoutSettings.HorizontalSeparation = 30;

        // Programmatic creation of shapes and connections
        AddDiagramShape("Shape1", "#8CB20F", "Shape 1", "#fff", RadDiagram1);
        AddDiagramShape("Shape2", "#F8C43A", "Shape 2", "#fff", RadDiagram1);
        AddDiagramShape("Shape3", "#F18100", "Shape 3", "#fff", RadDiagram1);
        ConnectDiagramShapes("Shape1", "Shape3", RadDiagram1);
        ConnectDiagramShapes("Shape2", "Shape3", RadDiagram1);


    }

    protected void AddDiagramShape(string shapeID, string backgroundColor, string contentText, string contentColor, RadDiagram diagram)
    {
        var shape = new DiagramShape()
        {
            Id = shapeID,
        };
        shape.ContentSettings.Text = contentText;
        shape.ContentSettings.Color = contentColor;
        shape.FillSettings.Color = backgroundColor;
        diagram.ShapesCollection.Add(shape);
    }

    protected void ConnectDiagramShapes(string startShapeID, string endShapeID, RadDiagram diagram)
    {
        var connection = new DiagramConnection();
        connection.FromSettings.ShapeId = startShapeID;
        connection.ToSettings.ShapeId = endShapeID;
        diagram.ConnectionsCollection.Add(connection);
    }


 

 

Regards,

Omar

 

Vessy
Telerik team
 answered on 31 Oct 2023
1 answer
121 views

Hi,

How to get all Rad Controls that are within the selected TAB PageView? using JS

I know that you can get all the controls within the form using this code.


 var allRadControls = $telerik.radControls;

Thanks,

Omar

 

Omar
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 30 Oct 2023
4 answers
281 views

Can anyone help with a database structure to create RadDiagram Shapes and Connectors in the database using co-ordinates to automatically load the diagram.

I couldn't find anything in the demos or docs. For example on the link beloq the sql connections are shown but not what structure is need to create this?

http://demos.telerik.com/aspnet-ajax/diagram/examples/databind/defaultcs.aspx  

Thank you.

 

Omar
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 30 Oct 2023
1 answer
99 views

I would like to put DataFormat on a cell level in a batch grid.

Jobs #                  5 

Unemployment  3.25% 

What is the best way?

Attila Antal
Telerik team
 answered on 27 Oct 2023
1 answer
187 views

I am using Aggregate="sum", but one of my rows contains years and should not be aggregated.

Is there a way?

Vasko
Telerik team
 answered on 27 Oct 2023
0 answers
122 views

When exporting to a CSV file the download works as expected with the delimiter set to comma. Once the delimiter is changed to any other value, i.e. Semicolon, Vertical bar the file opens in the browser window instead of downloading. 

Is there a way to initiate the download instead of opening the file in a browser window? 

Lee
Top achievements
Rank 1
Iron
 asked on 27 Oct 2023
1 answer
237 views

Hi,

I want to attach the client event to a dynamically created radio list.

Below is an example of a dynamically created radio list.

The question is, How to attach the JS function to OnSelectedIndexChanged, to display the selected radio value?

Many thanks in advance.

Omar

 

                RadRadioButtonList RBL = new RadRadioButtonList();
                RBL.ID = "Radio" + i.ToString();
                RBL.AutoPostBack = false;

                ButtonListItem answer1 = new ButtonListItem();
                answer1.Text = "Answer " + i.ToString();
                answer1.Value = i.ToString();
                RBL.Items.Add(answer1);

                ButtonListItem answer2 = new ButtonListItem();
                answer2.Text = "Answer " + i.ToString();
                answer2.Value = i.ToString();
                RBL.Items.Add(answer2);

                ButtonListItem answer3 = new ButtonListItem();
                answer3.Text = "Answer " + i.ToString();
                answer3.Value = i.ToString();
                RBL.Items.Add(answer3);

                RBL.ClientEvents.OnSelectedIndexChanged = "OnItemClicked";

Vasko
Telerik team
 answered on 26 Oct 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?