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 = ?
}
}
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.
Please Help me.
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.Is there any way to sort nodes based on hierarchyid?
currently default sorting based on alphabetical order.
Thanks in advance
Hello,
I have a form to show/update Staff information. There is a RadComboBox (CheckBoxes =True, DataSourceID = "sds_multiSites", DataTextField = "Site", DataValueField = "idSite"), that Iist all the Sites in our organization.
When the form loads, I read a table where I find the Staff-MultiSitesSelected. I read all the Sites where the staff works and I check this sites in the RadComboBox. I sort the RadComboBox by the TextValue, using rcb_multiSites.SortItems(New SortCheckedComboItemsFirst()), and this function let me keep the checked items at the top of the list.
Problem: When updating the combo selection, unchecking some items (that are at the top) and selecting new items. After the refresh, the new checked items are wrong even if I don't sort again. The selected index is wrong because is counting the old-checked items that were at the top.
Any suggestions?
cc
ASP.NET
<telerik:RadComboBox ID="rcb_multiSites" Runat="server" DataSourceID="sds_multiSites" DataTextField="Site" DataValueField="idSite" CheckBoxes = "True" EnableCheckAllItemsCheckBox = "true" AutoPostBack = "false" ></telerik:RadComboBox>
VB.NET read the selection from a table and check the selected items in the combo
Private Sub create_new_employee_SaveStateComplete(sender As Object, e As EventArgs) Handles Me.SaveStateComplete
Dim i As Integer ' event launched after load form
If Not IsPostBack Then
Dim conn3 As String = DirectCast(ConfigurationManager.ConnectionStrings("HR_ConnStr").ConnectionString, String)
Dim queryStr3 As String = "SELECT * FROM StaffSites WHERE IDPerson = @IDPerson ORDER BY Name"
Using myConnection3 As New SqlConnection(conn3)
Dim myCommand3 As New SqlCommand(queryStr, myConnection3)
myConnection3.Open()
myCommand3.Parameters.AddWithValue("@IDPDSProfilesPerson", IDPDSProfilesEmployee)
Dim MyReader3 As SqlDataReader = myCommand3.ExecuteReader
If MyReader3.HasRows Then
While (MyReader3.Read())
Dim idSite As String = MyReader3("IDSite")
Dim indexItem As Integer = rcb_multiSites.FindItemIndexByValue(idSite)
rcb_multiSites.Items(indexItem).Checked = True
End While
rcb_multiSites.Sort = RadComboBoxSort.Ascending
rcb_multiSites.SortItems(New SortCheckedComboItemsFirst())
rcb_multiSites.AllowCustomText = True
End If
End Using
End If
End Sub
This function sort the list and keeps the checked Items at the top. The function is from a sample in this website
VB.NET
Public Class SortCheckedComboItemsFirstHi,
My main thread is "Check All" feature is not working as expected with Load On Demand
As there is limitation on LoadOnDemand feature in RadComboBox control, as a workaround I used RadMultiSelect with Virtualization.
But when I add the below line it showing console error.
<VirtualSettings ItemHeight="26" ValueMapper="valueMapper" />As you requested in main thread I am attaching current implementation to investigate the problem.
Attaching relevant files for your reference since full project can't upload due to max size exceed.
Highly appreciate your quick response.
Thanks
Chandi

My team is using Telerik.UI.for.AspNet.Ajax.Net45 v 2020.3.1021. Due to having some clients on unsupported browsers, we need to redirect them to an older page that is compatible for them.
Do you offer any built-in functionality to determine if a Telerik control on a page is supported in the user's browser?

Regardless of browser, when you zoom out to text size 80% or less the text in the RadPanelBar disappears.
Is there a way to make the text visible regardless of the zoom level?
/POE

I'm using the RadMap to show states of the USA.
layers[0] is Bing.
layers[1] contains a shape for every US state/territory.
layers[2-53] contain the counties (subdivisions) for each state/territory.
When the user clicks a state, I handle the shapeClick event to .show() the corresponding layer for the state's counties. This works fine.
Once layer 2 - 53 is shown, however, the shapeClick no longer fires when a shape in layer 1 is clicked, presumably because it is no longer "on top" and shapeClick is only fired for layer x. Is there a way to receive shapeClick events no matter which layer is "on top"?
If not, is there a way to get the data from the map's regular Click event and somehow use that to determine the shape that covers it in layer 1?

So in my RadGrid I have a template column that contains RadDropDownList in the EditItemTemplate. When this is modified in a row I would like to loop through the RadGrid and modify the other RadDropDownList in the other rows. I know how to loop through the grid but having trouble accessing the dropdown since the other rows are not in edit mode. Using the changeCellValue(cellToUpdate, value) of the BatchEditingManager but not having any luck with updating the dropdown.
<BatchEditingSettings EditType="Cell" />
<telerik:GridTemplateColumn HeaderText="IsBudget" UniqueName="IsBudget" SortExpression="IsBudget">
<ItemTemplate>
<asp:Label ID="lblIsBudget" runat="server" Text='<%# Eval("IsBudget") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadDropDownList ID="ddIsBudget" RenderMode="Lightweight" runat="server" DataValueField="IsBudget" >
<Items>
<telerik:DropDownListItem Text="False" Value="False" />
<telerik:DropDownListItem Text="True" Value="True" />
</Items>
</telerik:RadDropDownList>
</EditItemTemplate>
</telerik:GridTemplateColumn>
