| function updateGrid(result) |
| { |
| var masterTableView = GetMasterTableView("<%=AGPermissions.ClientID %>"); |
| if (result) |
| { |
| masterTableView.set_dataSource(result); |
| masterTableView.dataBind(); |
| ToggleDivVisibility('ShowGridClient',true); |
| var grid = $find("<%= AGPermissions.ClientID %>"); |
| grid.repaint(); |
| <telerik:RadGrid ID="AGPermissions" EnableViewState="false" runat="server" |
| AllowPaging="false" AllowSorting="false" AllowFilteringByColumn="false" GridLines="None" |
| EnableEmbeddedSkins="false" Skin="IMCGridStyle" ImagesPath="Grid" |
| OnNeedDataSource="AGPermissions_NeedDataSource"> |
| <ItemStyle Wrap="false" /> |
| <MasterTableView |
| AllowMultiColumnSorting="true" |
| TableLayout="Auto" |
| EnableNoRecordsTemplate="false" |
| ClientDataKeyNames="AssetGroupID,AssetGroupPermissionType" |
| AutoGenerateColumns="false" |
| ShowHeadersWhenNoRecords="false"> |
| <Columns> |
| <telerik:GridBoundColumn DataField="AssetGroupID" Display="false" HeaderText="Asset Group ID" /> |
| <telerik:GridBoundColumn DataField="AssetGroupName" HeaderText="Asset Group" /> |
| <telerik:GridBoundColumn DataField="AssetGroupPermissionType" Display="false" HeaderText="Asset Group Permission Type" /> |
| <telerik:GridBoundColumn DataField="AssetGroupPermissionTypeText" HeaderText="Permission Type" /> |
| <telerik:GridButtonColumn UniqueName="1MakeGroupMaster" Visible="true" ButtonType="ImageButton" ImageUrl="Grid/btnMakeGM.jpg" CommandName="1MakeGroupMaster" Text="Make Group Master"></telerik:GridButtonColumn> |
| <telerik:GridButtonColumn UniqueName="2MakeGroupReader" ButtonType="ImageButton" ImageUrl="Grid/btnMakeGR.jpg" CommandName="2MakeGroupReader" Text="Make Group Reader"></telerik:GridButtonColumn> |
| <telerik:GridButtonColumn ConfirmText="Remove access to this Asset Group?" ButtonType="ImageButton" ImageUrl="Grid/btnRemove.jpg" CommandName="RemoveAccess" Text="Remove Access"></telerik:GridButtonColumn> |
| </Columns> |
| <NoRecordsTemplate> |
| <div>There are no records to display.</div> |
| </NoRecordsTemplate> |
| </MasterTableView> |
| <ClientSettings> |
| <ClientEvents |
| OnCommand="RadGridCommand" |
| OnDataBound="TestThis"/> |
| </ClientSettings> |
| <PagerStyle AlwaysVisible="true" /> |
| </telerik:RadGrid> |
Hello.
We are developing business rule engine. Users can create database structure, objects, web forms and so on. Now, we would like to provide the users with the ability to set up Telerik ASP.NET Ajax controls using xml set up files.
These files have the same structure like html code snippets used in VS.NET Designer for every type of your control.
The main reasons for that is:
1) we can easily create xml schema for "supported subset of features"
2) there are too many features to create special form for every property of the control
...
The question is How to interpret there xml files to set up controls.
1) With help of reflection. => We need to cast strings in xml attributes to proper types.
2) Use already existing functionality in VS.NET designer to read aspx files and set up controls on the fly.
What do you think about that? I know nothing about the second option. Can you help me, please?
Thank you very much.
Tom
Below are the java scrip and code behind.
SInce we have a lot of data for the drop down box, we are not loading the drop down on the page load.
User will start typing the value and then we will return data to the control.
If i typed 56 in the drop down, no data is populating, if i backspace 6, then i do get data that starts with 56
If i type 5 nothing happend, if i typed 5 and backspaced then it is loading data
Can you please help?
function
OnVendorNameKeyPress(sender, eventArgs)
{
var a = eventArgs.get_domEvent().keyCode;
// 8 - Backspace
// 127 - Delete
if (a >= 32 && a <= 126 || a == 8 || a == 127)
{
var b = sender.get_text() ? sender.get_text() : '';
if (a >= 32 && a <= 126)
{
b += String.fromCharCode(a);
}
if (b && b != $$$._vendorNamePart)
{
$$$._vendorNamePart = b;
$$$._departmentReq =
false;
sender.requestItems(
'txt:' + b, false);
}
}
Protected
Sub ctlRComboBoxVendorID_ItemsRequested(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles ctlRComboBoxVendorID.ItemsRequested
If New DB_BLL.Cache().IsMaintain Then
e.Message =
""
Try
Dim comBox As RadComboBox = sender
If Not (comBox Is Nothing) Then
If Not (e.Text Is Nothing) And (e.Text.StartsWith("txt:") Or e.Text.StartsWith("id:")) Then
If e.Text.StartsWith("txt:") And e.Text.Length > 4 Then
Dim txt As String = e.Text.Substring(4)
Me.ctlRComboBoxVendorID.Items.Clear()
Dim vendorList As List(Of TMS402VH_VENDOR) = DB_VENDOR.GetAllVendorsByVendorNumber(txt)
If Not (vendorList Is Nothing) And vendorList.Count <> 0 Then
For Each info As TMS402VH_VENDOR In vendorList
Me.ctlRComboBoxVendorID.Items.Add(New RadComboBoxItem(info.VENDOR_ID.ToString() & " - " & info.VENDOR_NME.Trim(), info.VENDOR_ID))
Next
End If
ElseIf e.Text.StartsWith("id:") And e.Text.Length > 3 Then
Dim departmentId As Integer = 0
Try
departmentId = Convert.ToInt32(e.Text.Substring(3))
Catch ex As Exception
departmentId = 0
End Try
Me.ctlRComboBoxVendorID.Items.Clear()
Dim vendorList As List(Of TMS402VH_VENDOR) = DB_VENDOR.GetAllVendorsByDepartment(departmentId, String.Empty, False)
If Not (vendorList Is Nothing) And vendorList.Count <> 0 Then
For Each info As TMS402VH_VENDOR In vendorList
Me.ctlRComboBoxVendorID.Items.Add(New RadComboBoxItem(info.VENDOR_ID.ToString() & " - " & info.VENDOR_NME.Trim(), info.VENDOR_ID))
Next
End If
End If
End If
End If
Catch ex As Exception
e.Message = ex.Message
End Try
End If
End Sub