Hi,
I am trying raddiagram to generate dynamic organizational charts.
Every thing worked fine with version 2015.03.930.
But when we upgrade to any other version such as 2015.03.1111 the diagram does not render properly.
here is the markup used for raddiagram:
<
telerik:RadDiagram
ID
=
"_rdUnit1"
ClientIDMode
=
"Static"
runat
=
"server"
Editable
=
"False"
EnableViewState
=
"False"
OnItemDataBound
=
"_rdUnit1_OnItemDataBound"
>
<
clientevents
onclick
=
"OnClick"
onload
=
"diagram_load"
/>
<%--<
layoutsettings
enabled
=
"True"
type
=
"Tree"
subtype
=
"TipOver"
></
layoutsettings
>--%>
<
shapedefaultssettings
type
=
"rectangle"
height
=
"35"
width
=
"110"
visual
=
"visualizeShape"
>
<
StrokeSettings
DashType
=
"Solid"
Color
=
"Black"
Width
=
"0.9"
></
StrokeSettings
>
<
ContentSettings
Align
=
"center"
Color
=
"Black"
FontSize
=
"18"
FontFamily
=
"Byekan"
></
ContentSettings
>
<
FillSettings
Color
=
"White"
></
FillSettings
>
</
shapedefaultssettings
>
<
bindingsettings
>
<
ShapeSettings
DataIdField
=
"UnitId"
DataContentTextField
=
"Name"
DataTypeField
=
"ShapeType"
DataFillColorField
=
"BackColor"
DataStrokeDashTypeField
=
"BorderType"
DataXField
=
"Xposition"
DataYField
=
"Yposition"
DataWidthField
=
"WidthShape"
DataHeightField
=
"HeightShape"
DataStrokeColorField
=
"BorderColor"
DataContentAlignField
=
"FontSize"
/>
<
ConnectionSettings
DataFromShapeIdField
=
"ParentId"
DataToShapeIdField
=
"UnitId"
/>
</
bindingsettings
>
</
telerik:RadDiagram
>
I've attached the correct rendering and the one that does not render properly.
Am I doing something wrong?
Hello!
I have a grid with RadComboBox in an EditItemTemplate:
<
telerik:GridTemplateColumn
DataField
=
"Value"
HeaderText
=
"Wert"
>
<
EditItemTemplate
>
<
telerik:RadComboBox
ID
=
"cboFeatureValue"
runat
=
"server"
DataSourceID
=
"odsFeatureValueList"
SelectedValue='<%# Bind("Value") %>' DataTextField="Text" DataValueField="Value"
Skin="Default">
</
telerik:RadComboBox
>
</
EditItemTemplate
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblFeatureValue"
runat
=
"server"
Text='<%# Eval("Value") %>'></
asp:Label
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
On some rows, depending on the data, I need a TextBox instead of the RadComboBox. Any idea how to achieve this?
I tried adding the TextBox in the EditITemTemplate and disabling the not wanted control:
<
asp:TextBox
runat
=
"server"
Text='<%# Bind("Value") %>' ID="txtFeatureValue"/>
and in here I disable the not wanted control:
Private Sub grdFeatureList_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles grdFeatureList.ItemDataBound
If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
Dim dataItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
If _FeatureParameter.Contains("Enum") Then
Dim textBox As TextBox = CType(dataItem.FindControl("txtFeatureValue"), TextBox)
textBox.Enabled = False
textBox.Visible = False
Else
Dim radComboBox As RadComboBox = CType(dataItem.FindControl("cboFeatureValue"), RadComboBox)
radComboBox.Enabled = False
radComboBox.Visible = False
End If
End If
End Sub
The problem is, that the Selecting event of the RadComboBox is called before I can disable the ComboBox. And as I don't have any data for the combo box I get an "Selection out of range" exception.
Thanks for helping!
Regards,
Tonino.
I have figured out how to create a custom FieldEditor with a combobox with checkboxes, however I would like to be able to make multiple selections and set the expression up using IN functionality....instead of EqualTo. For example:
Currently the expression will look like (FieldName = 'value1'). I want to be able to have it look like FieldName IN ('value1', 'value2')
For GridBoundColumns which have auto generated filters I've written javascript that when a cell is clicked its value is put in the filter text box. Users can then use that value as if they'd typed it into the filter text box.
I have a numeric bound column for which I want the same capability.
Info I've gathered so far leads me to think I should use the .set_value() command, but all the examples I've found assume I know the control's ID to get it, but because it's auto generated I don't.
At present the numeric value is appearing in the filter text box, but the filter button does not react to its presence.
EG
function CopyNumericValue()
{
var radNumericTextBox1 = $find("<%= RadNumericTextBox1.ClientID %>");
var radNumericTextBox2 = $find("<%= RadNumericTextBox2.ClientID %>");
radNumericTextBox1.set_value(radNumericTextBox2.get_value() + 1);
}
Grid
<telerik:RadGrid runat="server" ID="RadGrid1" RenderMode="Classic" Skin="Office2010Blue" EnableViewState="true" ClientIDMode="AutoID"
AllowPaging="True" OnPageIndexChanged="RadGrid1_PageIndexChanged" OnPageSizeChanged="RadGrid1_PageSizeChanged"
AllowSorting="true" OnSortCommand="RadGrid1_SortCommand"
AllowFilteringByColumn="True" OnNeedDataSource="RadGrid1_NeedDataSource"
GridLines="Horizontal">
<AlternatingItemStyle Height="16px" BackColor="#e4eaf1" />
<ItemStyle Height="16px" />
<MasterTableView AutoGenerateColumns="false" DataKeyNames="SalesOrderId" ClientDataKeyNames="SalesOrderId">
<Columns>
<telerik:GridBoundColumn DataField="SalesOrderId" HeaderText="SalesOrderId" Visible="false"
UniqueName="SalesOrderId" AllowFiltering="false">
</telerik:GridBoundColumn>
...
<telerik:GridBoundColumn DataField="StatusName" HeaderText="Status" UniqueName="StatusName" FilterControlWidth="80%">
<HeaderStyle Width="10%" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<telerik:GridNumericColumn DataField="OrderTotal" HeaderText="Total" UniqueName="OrderTotal" FilterControlWidth="60%"
DecimalDigits="2" DataFormatString="{0:### ##0.00}">
<HeaderStyle Width="7%" HorizontalAlign="Right" />
<ItemStyle HorizontalAlign="Right" />
</telerik:GridNumericColumn>
</Columns>
<PagerStyle PageSizes="10,15,20,25" AlwaysVisible="true" Position="Top" />
</MasterTableView>
<ClientSettings>
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
<Selecting CellSelectionMode="SingleCell" />
<ClientEvents OnCellSelecting="populateFilterTextBoxes" />
</ClientSettings>
</telerik:RadGrid>
Javascript
function populateFilterTextBoxes(sender, eventArgs) {
var selectedColumn = eventArgs.get_column();
var selectedColumnUniqueName = selectedColumn.get_uniqueName();
var selectedColumnElement = selectedColumn.get_element();
var selectedColumnCellIndex = selectedColumnElement.cellIndex;
var selectedRow = eventArgs.get_row();
var selectedCell = selectedRow.cells[selectedColumnCellIndex];
var value = selectedCell.innerText;
var inputs = document.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
var curInput = inputs[i];
//_FilterTextBox_ for normal bound columns
if (curInput.id.endsWith("_FilterTextBox_" + selectedColumnUniqueName)) {
curInput.innerText = value;//prototype endsWith in DefaultEditor.Master
break;
}
//_RNTBF_ for Numeric columns
if (curInput.id.endsWith("_RNTBF_" + selectedColumnUniqueName)) {
curInput.innerText = value;
break;
}
}
}
HTML of filter controls
<td style="white-space:nowrap;">
<input name="RadGrid1$ctl00$ctl02$ctl02$FilterTextBox_StatusName" type="text" size="10"
id="RadGrid1_ctl00_ctl02_ctl02_FilterTextBox_StatusName" class="rgFilterBox" alt="Filter StatusName column"
onkeypress="if((event.keyCode == 13)) return false;" style="height:22px;width:80%;" />
<input type="button" name="RadGrid1$ctl00$ctl02$ctl02$Filter_StatusName" value=" "
onclick="$find("RadGrid1")._showFilterMenu("RadGrid1_ctl00", "StatusName", event); return false;__doPostBack('RadGrid1$ctl00$ctl02$ctl02$Filter_StatusName','')"
id="RadGrid1_ctl00_ctl02_ctl02_Filter_StatusName" title="Filter" class="rgFilter" />
</td>
<td style="white-space:nowrap;">
<span id="RadGrid1_ctl00_ctl02_ctl02_RNTBF_OrderTotal_wrapper" class="riSingle RadInput RadInput_Office2010Blue" style="width:60%;">
<input id="RadGrid1_ctl00_ctl02_ctl02_RNTBF_OrderTotal" name="RadGrid1$ctl00$ctl02$ctl02$RNTBF_OrderTotal" class="riTextBox riEnabled"
alt="Filter OrderTotal column" type="text" />
<input id="RadGrid1_ctl00_ctl02_ctl02_RNTBF_OrderTotal_ClientState" name="RadGrid1_ctl00_ctl02_ctl02_RNTBF_OrderTotal_ClientState" type="hidden" />
</span>
<input type="button" name="RadGrid1$ctl00$ctl02$ctl02$Filter_OrderTotal" value=""
onclick="$find("RadGrid1")._showFilterMenu("RadGrid1_ctl00", "OrderTotal", event); return false;__doPostBack('RadGrid1$ctl00$ctl02$ctl02$Filter_OrderTotal','')"
id="RadGrid1_ctl00_ctl02_ctl02_Filter_OrderTotal" title="Filter" class="rgFilter" />
</td>
public override void SetEditorValues(ArrayList values) { if (values != null && values.Count > 0) { foreach (var item in values) { if (item == null) return; var comboItem = _combo.FindItemByValue(item.ToString()); if (comboItem != null) comboItem.Checked = true; } } }
Hi,
There is any way to bind a grid with a DataTable client side?
At some pages I call web methods that retuns lists of objects to databind, bat I have one grid that the source has to be a datatable and I can't bind a data table client side.
Thanks
Hi, I am new to Telerik and ASP.NET, but not to programming. I have multiple controls (radcomboboxes, text fields) repeated in rows of a table. Each row's field names are appended with a digit to differentiate(ddlChild1, ddlChild2, etc.). I am wanting to modify 4 of the controls in that row, based on the selection of in the combo box (ddlChildx). I am trying to minimize the code needed, so instead of having a block of code and duplicating it 10 times for each of the rows/controls' SelectedIndexChanged event, I wanted to pass the controls in the row to a function or subroutine by reference. However, when I try to declare the parameters 'As Telerik.RadComboBox', it lists Telerik as a namespace not a class in the pop up help when writing out the code. So, it isn't able to bring up the Methods in that parameter.
What do I need to do for the subroutine or function to recognize the telerik control so I can pass it by reference and just do changes to the .SelectedValues or .Text in my subroutine or function. I tried just defining the parameters as dropdownbox, but in compile it said that I couldn't pass the Telerik control to the function
Thanks in advance for your help.
Here's the code to call the function for one of the rows:
Public Sub ddlChild1_SelectedIndexChanged(sender As Object, e As RadComboBoxSelectedIndexChangedEventArgs) Handles ddlChild1.SelectedIndexChanged
'Child Selected Now Default other fields
Dim intPos As Integer
intPos = InStr(ddlChild1.Text, "-")
If intPos <> 0 Then
If Mid(ddlChild1.Text, intPos + 1, 3) = "000" Then
'Not a Child
If Mid(ddlChild1.Text, intPos - 1, 2) = "MG" Then
ddlAccount1.SelectedValue = "MG"
End If
Else
'Child
'Get Next Applied From and To Dates
Functions.fGetAppliedFromTo(ddlChild1, ddlAccount1, txtFrom1, TxtTo1)
'Get Next Support Due
Functions.fGetAmountOwed(ddlChild1, txtAmount1)
End If
End If
End Sub
Here's the beginning of one of the functions:
Public Shared Function GetAppliedFromTo(ByRef ddlChild As DropDownList, ByRef ddlAccount As DropDownList, ByRef txtFrom As TextBox, ByRef txtTo As TextBox)