<telerik:RadGrid ID="RecipientsGrid" runat="server" AutoGenerateColumns="false" EnableViewState="true" PageSize="5" AllowFilteringByColumn="true" AllowPaging="true" AllowSorting="True">
<EditFormSettings EditFormType="Template">
<FormTemplate>
<telerik:RadComboBox ID="CountryCombo" runat="server">
</telerik:RadComboBox>
<telerik:RadComboBox ID="ProvinceCombo" runat="server" Width="325" >
</telerik:RadComboBox>
</FormTemplate>
</EditFormSettings>
</telerik:RadGrid>
Private Sub RecipientsGrid_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RecipientsGrid.ItemDataBound If TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then Dim editItem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem) Dim ProvinceCombo As RadComboBox = TryCast(editItem.FindControl("ProvinceCombo"), RadComboBox) Dim CountryCombo As RadComboBox = TryCast(editItem.FindControl("CountryCombo"), RadComboBox) Dim CityCombo As RadComboBox = TryCast(editItem.FindControl("CityCombo"), RadComboBox) '** Populate ComboBoxes and define their Default Value Using context As New DataEntities With CountryCombo .DataValueField = "CountryId" .DataTextField = "CountryName" .DataSource = context.Countries.OrderBy(Function(x) x.displayOrder).ToList End With CountryCombo.Width = Unit.Pixel(320) CountryCombo.DataBind() End Using Using context As New DataEntities With ProvinceCombo .DataValueField = "ProvinceId" .DataTextField = "NameEnglish" .DataSource = context.Provinces.Where(Function(x) x.CountryId = CountryId).OrderBy(Function(x) x.NameEnglish).ToList End With ProvinceCombo.Width = Unit.Pixel(320) ProvinceCombo.DataBind() End Using Using context As New DataEntities With CityCombo .DataValueField = "CityId" .DataTextField = "CityName" .DataSource = context.Cities.Where(Function(x) x.ProvinceID = ProvinceId).OrderBy(Function(x) x.CityName).ToList End With CityCombo.Width = Unit.Pixel(320) CityCombo.DataBind() End Using SetComboBoxDefault(CountryId, CountryCombo, "Country") SetComboBoxDefault(ProvinceId, ProvinceCombo, "Province/State") SetComboBoxDefault(CityId, CityCombo, "City") End If End Sub Public Sub SetComboBoxDefault(ByVal FindItemByValue As Integer, ByVal Control As RadComboBox, ByVal DisplayText As String) Dim ComboBoxItem As RadComboBoxItem If FindItemByValue >0 Then ComboBoxItem = Control.FindItemByValue(FindItemByValue) ComboBoxItem.Selected = True Else Control.Items.Insert(0, New RadComboBoxItem("-- Please select a " & DisplayText & " --", String.Empty)) End If End Sub Private Sub RecipientsGrid_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RecipientsGrid.ItemCreatedIf TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then 'if the item is in edit mode Dim editItem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem) Dim CountryCombo As RadComboBox = DirectCast(editItem.FindControl("CountryCombo"), RadComboBox) CountryCombo.AutoPostBack = True AddHandler CountryCombo.SelectedIndexChanged, AddressOf CountryCombo_SelectedIndexChanged End If End Sub Protected Sub CountryCombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As RadComboBoxSelectedIndexChangedEventArgs) If RecipientsGrid.MasterTableView.IsItemInserted <> False Then Dim insertItem As GridEditFormInsertItem = DirectCast(TryCast(sender, DropDownList).NamingContainer, GridEditFormInsertItem) Dim ddlList As DropDownList = DirectCast(insertItem.FindControl("Dropdownlist2"), DropDownList) Else Dim CountryCombo As RadComboBox = DirectCast(sender, RadComboBox) Dim editedItem As GridEditableItem = DirectCast(TryCast(sender, RadComboBox).NamingContainer, GridEditableItem) Dim ProvinceCombo As RadComboBox = DirectCast(editedItem.FindControl("ProvinceCombo"), RadComboBox) Using context As New DataEntities With ProvinceCombo .DataValueField = "ProvinceId" .DataTextField = "NameEnglish" .DataSource = context.Provinces.Where(Function(x) x.CountryId = e.Value).OrderBy(Function(x) x.NameEnglish).ToList End With ProvinceCombo.Width = Unit.Pixel(320) ProvinceCombo.DataBind() End Using End If End Sub<%--<telerik:GridButtonColumn ButtonType="LinkButton" Text="<img src='../App_Themes/default/images/genDoc.gif' border='0' title='Generate Document'/>" UniqueName="GD" CommandName="G"></telerik:GridButtonColumn>--%><telerik:GridTemplateColumn HeaderText="" UniqueName="Image"><ItemTemplate>
<asp:ImageButton ID="GD" runat="server" ImageUrl="~/App_Themes/Default/images/genDoc.gif" CommandName="1" OnClick="ImageButton1_Click">
</asp:ImageButton>
</ItemTemplate><br></telerik:GridTemplateColumn>
Hello
I am considering such scenario - one web service for appointments and multi-client schedulers.
I have created asp.net page with radscheduler and webservice binding.
Now I am trying to use this web service for winforms scheduler (I am performing some operations in web service so solution with direct db access is unacceptable for me and I would like to have everything in one piece, in web service).
So I am trying to get appointments from this web service - unfortunately it is JSON service so it is not so easy..
I can't deserialize such method in forms client
public List<AppointmentData> GetJSONScheduler(SchedulerInfo schedulerInfo)
I am suceesfully invoke this method (but I have to make some modifications in JSON string before send it) and I can't deserialize return List
I have been trying:
DataContractJsonSerializer dJSON = new DataContractJsonSerializer(typeof(List<AppointmentData>);List<AppointmentData> sr = (List<AppointmentData>)dJSON.ReadObject(str);//str is response from HttpWebResponse JavaScriptSerializer jscriptDeserializer = new JavaScriptSerializer(); jscriptDeserializer.RecursionLimit = 100; List<AppointmentData> srResult = jscriptDeserializer.Deserialize<List<AppointmentData>>(sbResponse.ToString());//sbResponse is StringBuilder made from GetResponseStream() of HttpWebResponse
Do you have any advices?
Thanks in advance
Regards
I created two web solutions, A and B. And I added a data entry web form (DataEntery.aspx) into Solution A, with third party user controls and form authentication.
I want to use the web page DataEntery.aspx into solution B. What is the best method for it?
