Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
56 views

Why don't you reply?

Tired of repeating the same answer to your customers over and over again?

I am not American. So I am not good at reading English. I am currently writing the article after translating it into English using Google Translate. Aren't we supposed to help people with disabilities in English? Is telerik annoyed with answering customers?

I hope my question is answered.


I am waiting for your reply for several days.
Telerik does not respond to customers.
Inconvenient to use Telerik.

 

 

Hello.

I need help.

I need the coordinates of Column + Row of the selected cell in Radgrid.
Is the syntax of the source I attached correct?

please reply.

keep waiting for your reply

I want to communicate with client side and server side.


In Server Side(ASP.NET), 
<ClientSettings>
    <Selecting CellSelectionMode="MultiCell" />
    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    <ClientEvents OnCellSelected="cellSelected" />
</ClientSettings>

In JavaScript,
function cellSelected(sender, args)
{
            var selectedRow = args.get_row();
            var selectedColumn = args.get_column();
            var dataItem = args.get_gridDataItem();
            var tableView = args.get_tableView();
            var cellIndex = args.get_cellIndexHierarchical();
            var output = String.format("The selected cell is located in column with name: " + selectedColumn.get_uniqueName() + " and in row with index: " + dataItem.get_itemIndexHierarchical() + ". This cell has index " + cellIndex + " and it is part from " + tableView.get_name() + ".");

sender.get_masterTableView().fireCommand("cellSelected",    ????????????? );

}



Is the syntax of the source I attached correct?

To get the Selected Column&Row Coordinate

Client Side (aspx.cs)

protected void gv_ItemConmmand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "cellSelected")
    {
 var clickedColumnName = e.CommandArgument.ToString();

         // Label1.Text = clickedColumnName;
     }
 }

Do you have any other code from this source?

In Server Side

<ClientSettings>
    <Selecting CellSelectionMode="MultiCell" />
    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    <ClientEvents OnCellSelected="cellSelected" />
</ClientSettings>

In Client Side

protected voidRadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == "CellClick")
    {
        var selectedColumn = e.Item.selectedColumn.get_uniqueName();
        var selectedRow = e.Item.get_row();
    }
}

Is the syntax of the source I attached correct?                     

anna
Top achievements
Rank 1
Bronze
Iron
 updated question on 03 Feb 2022
1 answer
209 views

I have a RadHtmlChart in an ASP.NET application to show a pie chart that has stopped working for some reason, it just shows a blank space instead of where the chart is supposed to be. I think that it may have been a result of updating from Telerik 2019 to 2021, but I don't know for sure.

I see an error in the console log like this that I think may be related:

Uncaught SyntaxError: '' string literal contains an unescaped line break
    _getMainConfig https://mydomain/ScriptResource.axd?d=tbtXkupOsJbh23R1_Hx7q2pZp3JxD5nSFapGUZ3sqXMSswV2X1Q2E1yGmyRwIn4zcz_FaG3pZ673Wbd7B-S8wD0iEyTbmgkuVT3xUNxMNje2tXgtmPHlNMU2UCqG2qcKV9OzjA2&t=244d15ab:97

 

At first I thought it was a bad label or something but even stubbing out all the labels doesn't seem to fix it, so I don't know.

 

Vessy
Telerik team
 answered on 03 Feb 2022
1 answer
167 views

I need more specifics about how to cancel a tab switch when using the RadTabStrip. The information I have found on the Telerik help forums makes a lot of assumptions about knowledge of the programmer, and (although I have lots of programming experience) I'm fairly new at Telerik and asp programming in general. 

I'm using the Telerik RadTabStrip and I need to cancel on the client side the switching from one tab to another. The RadTabStrip is on a general management page that references the other tabs (asp pages), one for each tab.

In the first tab asp page, I have a hidden control that contains an indicator if the page is dirty. 

In the management page, containing the RadTabStip, I have a java script function for the OnClientTabSelecting. From the management page java script function for OnClientTabSelecting I need to A) check if I'm leaving the page which may be dirty and B) if that is the page i'm leaving then I need to check the dirty flag. If both A and B are true, then C) I need to prompt the user, warning them that the page is dirty and confirming that they do want to leave. If they do not, then I want to cancel the tab switch. 

I understand how to to C) above, but could you please provide some example code of both A) and B) above? If the examples exist elsewhere, then a link to those examples would be very helpful.

Thank you!

 

 

Peter Milchev
Telerik team
 answered on 02 Feb 2022
0 answers
112 views

Hi,

I am binding data to RadMultiSelect control through web service method.

when I am trying to filter data (typing on RadMultiselect control) it calls web service method twice.

Issue is, either it holds the filter value in first time hit, second time hit filter value get cleared. 

How can I prevent web service multiple times hit.

I have inserted the code for your reference.

<div>
            <telerik:RadScriptManager runat="server" ID="RadScriptManager1">
                <Scripts>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                </Scripts>
            </telerik:RadScriptManager>
            <telerik:RadAjaxPanel ID="ap" runat="server">
                <telerik:RadMultiSelect runat="server" Filter="Contains" EnforceMinLength="false" AutoClose="false" DataTextField="description" DataValueField="department" 
                Width="400px" ID="RadMultiSelect1" Placeholder="Shipping names..." DropDownHeight="130" ClientDataSourceID="RadClientDataSource1" AutoPostBack="false">
                <VirtualSettings ItemHeight="26" ValueMapper="valueMapper"  />
                <ItemTemplate>
                    <span class='order-id'>#= department #</span> #= description #
                </ItemTemplate>            
            </telerik:RadMultiSelect>
                <telerik:RadClientDataSource ID="RadClientDataSource1" runat="server"
                                EnableServerFiltering="true"
                                AllowPaging="true"
                                EnableServerPaging="true" PageSize="20">
                        <ClientEvents OnCustomParameter="OnCustomParameter" />
                        <DataSource>                                    
                            <WebServiceDataSourceSettings ServiceType="Default">                                        
                                <Select Url="WebService1.asmx/GetOrders" DataType="JSON" RequestType="Post" ContentType="application/json;charset=utf-8" />
                                    </WebServiceDataSourceSettings>
                                </DataSource>
                                <Schema DataName="d.Data" TotalName="d.Count" ResponseType="JSON">
                                    <Model>
                                        <telerik:ClientDataSourceModelField DataType="String" FieldName="department" />
                                        <telerik:ClientDataSourceModelField DataType="String" FieldName="description" />                                            
                                    </Model>
                                </Schema>
                            </telerik:RadClientDataSource>
                </telerik:RadAjaxPanel>
        </div>

 

Thanks & Regards,

Chandi

chandi
Top achievements
Rank 1
 asked on 02 Feb 2022
1 answer
162 views

Hi Telerik's friends

I have a RadComboBox that I load with a DataTable. This is my code:

    Private Sub LoadAgente()
        Dim rcbElemento As New RadComboBoxItem

        Me.rcbAgente.DataSource = GetNombreAgente() ' Get DataTable
        Me.rcbAgente.DataValueField = "CodigoPersona"
        Me.rcbAgente.DataTextField = "NombreCompleto"
        Me.rcbAgente.DataBind()

        rcbElemento.Value = "0"
        rcbElemento.Text = "Seleccione un agente"
        Me.rcbAgente.Items.Insert(0, rcbElemento)
        rcbElemento = Nothing

        Me.rcbAgente.ClearSelection()
        Me.rcbAgente.SelectedValue = "0"
    End Sub

But this don't work.

I need your help. please.

Thanks

Rumen
Telerik team
 answered on 01 Feb 2022
0 answers
113 views

Hello.

I need help.

I need the coordinates of Column + Row of the selected cell in Radgrid.
Is the syntax of the source I attached correct?

please reply.

keep waiting for your reply

I want to communicate with client side and server side.


In Server Side(ASP.NET), 
<ClientSettings>
    <Selecting CellSelectionMode="MultiCell" />
    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    <ClientEvents OnCellSelected="cellSelected" />
</ClientSettings>

In JavaScript,
function cellSelected(sender, args)
{
            var selectedRow = args.get_row();
            var selectedColumn = args.get_column();
            var dataItem = args.get_gridDataItem();
            var tableView = args.get_tableView();
            var cellIndex = args.get_cellIndexHierarchical();
            var output = String.format("The selected cell is located in column with name: " + selectedColumn.get_uniqueName() + " and in row with index: " + dataItem.get_itemIndexHierarchical() + ". This cell has index " + cellIndex + " and it is part from " + tableView.get_name() + ".");

sender.get_masterTableView().fireCommand("cellSelected",    ????????????? );

}



Is the syntax of the source I attached correct?

To get the Selected Column&Row Coordinate

Client Side (aspx.cs)

protected void gv_ItemConmmand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "cellSelected")
    {
 var clickedColumnName = e.CommandArgument.ToString();

         // Label1.Text = clickedColumnName;
     }
 }

Do you have any other code from this source?

In Server Side

<ClientSettings>
    <Selecting CellSelectionMode="MultiCell" />
    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    <ClientEvents OnCellSelected="cellSelected" />
</ClientSettings>

In Client Side

protected voidRadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == "CellClick")
    {
        var selectedColumn = e.Item.selectedColumn.get_uniqueName();
        var selectedRow = e.Item.get_row();
    }
}

Is the syntax of the source I attached correct?                     

anna
Top achievements
Rank 1
Bronze
Iron
 updated question on 31 Jan 2022
0 answers
116 views

I have hierarchal data with thousands of nodes.  I am using a RadTreeView control with "Load On Demand" mode, with Expand mode set to "ServerSideCallback".  I set up the handler. It creates the child nodes, grabs about 10 custom fields and adds them to the "Attributes" collection, and adds the nodes to e.Node.Nodes collection.  All of this is working great, but I want to display values from the Attributes collection.

How do I access those attributes from the NodeTemplate? 

The node template seems to work, but it is not showing the fields. I assume this is because I am just adding the nodes and do not call "DataBind"?

Thanks.

Mike
Top achievements
Rank 1
 asked on 30 Jan 2022
0 answers
147 views

hi

I have 4 table hierarchies in Radgrid.

to fill out  "SqlDataSource_Third"
Table "Third_Table"
Need to access "DataKeyNames" All Parent tables including access to:

"Master_ID" from "Mater_Table" table
"First_ID" from table "First_Table"
"Second_ID" from the "Second_Table" table

I Need "DataKeyNames" All Parent tables In the event:

"RadGrid1_DetailTableDataBind"
Do I have access?

 

 


        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource_Master" AutoGenerateColumns="False" OnDetailTableDataBind="RadGrid1_DetailTableDataBind">
            <MasterTableView DataSourceID="SqlDataSource_Master" Name="Master_Table" DataKeyNames="Master_ID">
                <DetailTables>
                    <telerik:GridTableView runat="server" Name="First_Table" DataKeyNames="First_ID" DataSourceID="SqlDataSource_First">
                        <DetailTables>
                            <telerik:GridTableView runat="server" Name="Second_Table" DataKeyNames="Second_ID" DataSourceID="SqlDataSource_Second">
                                <DetailTables>
                                    <telerik:GridTableView runat="server" Name="Third_Table" DataKeyNames="Third_ID" DataSourceID="SqlDataSource_Third">
                                        <Columns>
                                            <telerik:GridBoundColumn UniqueName="column_Third">
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                    </telerik:GridTableView>
                                </DetailTables>
                                <Columns>
                                    <telerik:GridBoundColumn UniqueName="column_Second">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </telerik:GridTableView>
                        </DetailTables>
                        <Columns>
                            <telerik:GridBoundColumn UniqueName="column_First">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn UniqueName="column_Master">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>



        <asp:SqlDataSource ID="SqlDataSource_Third" runat="server">
            <SelectParameters>
                <asp:Parameter Name="Master_ID" Type="Int32" />
                <asp:Parameter Name="First_ID" Type="Int32" />
                <asp:Parameter Name="Second_ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>


 


        protected void RadGrid1_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            if (e.DetailTableView.Name == "Third_Table")
            {
                GridTableView detailtabl1 = (GridTableView)e.DetailTableView;
                GridDataItem Third_parentItem = (GridDataItem)detailtabl1.ParentItem;


                SqlDataSource_Third.SelectParameters["Second_ID"].DefaultValue = Third_parentItem.GetDataKeyValue("Second_ID").ToString();

                SqlDataSource_Third.SelectParameters["Master_ID"].DefaultValue = ?

                SqlDataSource_Third.SelectParameters["First_ID"].DefaultValue = ?


            }
        }

Mohamad Javad
Top achievements
Rank 2
Iron
Iron
Iron
 updated question on 30 Jan 2022
0 answers
102 views

Attached File : WebApplication14.zip , RadListBox.png

I will convert the attached file to RadListBox.

You need to add 2 Labels to the RadListBox in the attached file.

Conversion condition requires adding 2 Labels to RadListBox.

Attached files(WebApplication14.zip) must be converted like attached files(RadListBox.png).

 

 

Please Help me.

anna
Top achievements
Rank 1
Bronze
Iron
 asked on 30 Jan 2022
0 answers
106 views

Attached File : RadListBox.png

ASP.NET, RadListBox, Web

Question-1) ItemTemplate of RadListBox, By applying multi-label, Is it possible to implement multi-column of ListBox?

Question-2) If Question-1 is possible, As in the attached file, After creating one more RadListBox, Is it possible to move data between listboxes?

Question-3) If Question-2 is possible, like the source below,Listbox.Item.Add(item),  Listbox.Item.Insert(index),  Listbox.SelectedItemindex, Listbox.Selected.Items.Count   

Can you code using functions?

private void AddRemoveAll(ListBox aSource, ListBox aTarget)
 {
  try
  {
   foreach(ListItem item in aSource.Items)
   aTarget.Items.Add(item);
   aSource.Items.Clear();
  }
  catch(Exception expException)
  {
    Response.Write(expException.Message);
  }
 }
private void private void MoveUp(ListBox lstBox)
 { 
  int   iIndex, iCount, iOffset, iInsertAt,iIndexSelectedMarker = -1;
  string lItemData,lItemval;

  try
   {
  // Get the count of items in the list control
  iCount = lstBox.Items.Count;
       
  // Set the base loop index and the increment/decrement value based
  // on the direction the item are being moved (up or down).
  iIndex = 0;
  iOffset = -1;
  // Loop through all of the items in the list.
  while(iIndex < iCount) 
   {
    // Check if this item is selected.
    if(lstBox.SelectedIndex > 0)
    {
    // Get the item data for this item
     lItemval =lstBox.SelectedItem.Value.ToString();
    lItemData = lstBox.SelectedItem.Text.ToString() ;
    iIndexSelectedMarker=lstBox.SelectedIndex; 
      
    // Don't move selected items past other selected items
       if(-1 != iIndexSelectedMarker)
       {
         for(int iIndex2 = 0; iIndex2 < iCount; ++iIndex2)
      {
        // Find the index of this item in enabled list
            if(lItemval == lstBox.Items[iIndex2].Value.ToString())
         {
           
          // Remove the item from its current position
             lstBox.Items.RemoveAt(iIndex2);  
             
      // Reinsert the item in the array one space higher 
             // than its previous position
             iInsertAt=(iIndex2 + iOffset)<0?0:iIndex2+iOffset;
             ListItem li= new ListItem(lItemData,lItemval);
          lstBox.Items.Insert(iInsertAt,li);
          break;
         }
        }
        }
     }
            
     // If this item wasn't selected save the index so we can check
        // it later so we don't move past the any selected items.
        else if(-1 == iIndexSelectedMarker)
        {
         iIndexSelectedMarker = iIndex;  
       break;
     }
      iIndex = iIndex + 1;
    }
    if(iIndexSelectedMarker==0)
      lstBox.SelectedIndex=iIndexSelectedMarker;
    else
      lstBox.SelectedIndex=iIndexSelectedMarker-1;
   }
   catch(Exception expException)
   {
    Response.Write(expException.Message); 
   } 
 } 

 

An example source for reference please.

Your answer is desperately needed.

I will keep waiting for your reply.
anna
Top achievements
Rank 1
Bronze
Iron
 updated question on 30 Jan 2022
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
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
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?