<telerik:GridTemplateColumn HeaderText="Select Countries" ItemStyle-Width="240px" UniqueName="List_of_Countries" > <ItemTemplate> <%# DataBinder.Eval(Container.DataItem, "List_of_Countries")%> </ItemTemplate> <EditItemTemplate> <telerik:RadComboBox runat="server" ID="rdComboCountries" DataTextField="country_name"
CheckBoxes="true" Width="250px" DataValueField="country_id" DataSourceID="SqlDataSourceCountries" SelectedValue='<%#Bind("List_of_Countries") %>'> </telerik:RadComboBox> </EditItemTemplate> </telerik:GridTemplateColumn> <asp:SqlDataSource runat="server" ID="SqlDataSourceCountries" ConnectionString="<%$ ConnectionStrings:mydbConnectionString %>" ProviderName="<%$ ConnectionStrings:mydbConnectionString.ProviderName %>" SelectCommand="SELECT country_id, Country_names FROM lu_countries"> </asp:SqlDataSource>Private Sub rgCountries_UpdateCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles rgCountries.UpdateCommand Dim editItem As GridDataItem = e.Item 'Pass the parameter values to the SqldataSource oDSMySqlCountries.UpdateParameters.Add(New Parameter("list_of_countries")) oDSMySqlCountries.UpdateParameters("list_of_countries").DefaultValue = GetCheckedItems(DirectCast(editItem.FindControl("rdComboCountries"), RadComboBox)) 'Update the values oDSMySqlCountries.Update() 'Bind the RadGrid again rgCountries.Rebind() End Sub Private Function GetCheckedItems(ByVal comboBox As RadComboBox) As String Dim sb As New StringBuilder() Dim collection As IList(Of RadComboBoxItem) = comboBox.CheckedItems For Each item As RadComboBoxItem In collection sb.Append(item.Value + ", ") Next Return sb.ToString.TrimEnd(" ").TrimEnd(",") End Functionforeach (CampaignHeader campaignItem in oCH) { ChartSeriesItem chartItem = new ChartSeriesItem(); chartItem.ActiveRegion.Url = string.Format("campaignviewer.aspx?CampaignId={0}", campaignItem.RecordId); chartItem.Name = campaignItem.CampaignName; chartItem.YValue = campaignItem.OAStart; chartItem.YValue2 = campaignItem.OAEnd; rcCampaign.Series[0].Items.Add(chartItem); }public void PopulateGrid()
{
try
{
DataTable dtDocList = new DataTable();
dtDocList = createDataTable(dtDocList);
DataRow docListRow = null;
if (FileExplorerDataSource.Count > 0)
{
foreach (DMSDocument currentDoc in FileExplorerDataSource)
{
docListRow = dtDocList.NewRow();
foreach (AspenDocumentListWebControlShowColumnsConfigurationElement column in AspenDocumentListUIConfig.ColumnsToShow)
{
foreach (DMSMetadata currProperty in currentDoc.Properties)
{
if (currProperty.Name == column.DataField)
{
docListRow[column.Name] = currProperty.Value;
break;
}
}
}
if (String.IsNullOrEmpty(filterExpression))
{
dtDocList.Rows.Add(docListRow);
}
else if (docListRow["DocumentType"].ToString() == filterExpression.ToString())
{
dtDocList.Rows.Add(docListRow);
}
}
if (String.IsNullOrEmpty(filterExpression))
{
Documents = dtDocList;
DataView sortedDocListView = new DataView(dtDocList);
if (dtDocList != null)
{
sortedDocListView.Sort = dtDocList.Columns["CreationDate"] + " DESC";
}
docListGrid.DataSource = sortedDocListView;
docListGrid.DataBind();
}
else
{
DataView sortedDocListView2 = new DataView(dtDocList);
if (dtDocList != null)
{
sortedDocListView2.Sort = dtDocList.Columns["CreationDate"] + " DESC";
}
//docListGrid.SortExpressions.Clear();
docListGrid.DataSource = sortedDocListView2;
docListGrid.Rebind();
}
}
else
{
//docListGrid.MasterTableView.NoRecordsTemplate = new NoRecordsTemplate();
}
}
catch (Exception)
{
// LogError(ex.Message + " /n Stack Trace :" + ex.StackTrace);
}
}
The filter expression will have the value of the tree node clicked.
This is quite urgent. Any help is very much appriciated.
Thanks in advance.
Regards
Rajeev
<style type="text/css">
.RadInput
{
display: none;
}
</style>
Protected Sub rgTimeslips_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles rgTimeslips.ItemCommand LogID = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("KeyID") DocID = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("SONumber") Label7.Text = LogID & "," & DocID pnlForm.Visible = True pnlLogGrid.Visible = False 'set values of Time Entry user control Dim u As UserControl = TryCast(FindControl("TimeEntry2"), UserControl) Dim ddlso As DropDownList = TryCast(u.FindControl("ddlSO"), DropDownList) ddlso.SelectedValue = DocID Dim SOLogKeyID As HiddenField = TryCast(u.FindControl("SOLogKeyID"), HiddenField) Dim TimeSlipKeyID As HiddenField = TryCast(u.FindControl("TimeSlipKeyID"), HiddenField) If DocID = 0 Then SOLogKeyID.Value = "0" TimeSlipKeyID.Value = LogID Else SOLogKeyID.Value = LogID TimeSlipKeyID.Value = "0" End If ddlso.Enabled = False End Sub<telerik:RadGrid ID="rgDepartaments" runat="server" AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="true" PageSize="10" AllowMultiRowEdit="true" OnItemCreated="rgDepartaments_ItemCreated"> <MasterTableView DataKeyNames="IdDepartament" ClientDataKeyNames="IdDepartament" CommandItemDisplay="Bottom"> <Columns> <telerik:GridBoundColumn UniqueName="Departament" DataField="Departamento" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridDateTimeColumn UniqueName="UpdateDate" DataField="UpdateDate" DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy HH:mm}" HeaderStyle-Width="150px"> </telerik:GridDateTimeColumn> </Columns> </MasterTableView> <ClientSettings> <DataBinding Location="~/DesktopModules/Comun/Services/DepartmentSvc.svc" SelectCountMethod="TotalDepartments"> <DataService TableName="Departament" /> </DataBinding> </ClientSettings></telerik:RadGrid>[WebGet]public int TotalDepartments(string where){ return String.IsNullOrEmpty(where) ? this.CurrentDataSource.Department.Count() : this.CurrentDataSource.Department.Where(where).Count();}TotalDepartments is executed with a where condition having a UpdateDate filter I get the following error: Edm.DateTime and Edm.String are not compatible types. UpdateDate (21/07/2011 --> 21st July 2011). When I try to filter through UpdateDate width 16/07/2011 and "major than" I get no record (all records must have been returned). By if I filter with 16/07/2001 and "less than" I get all the records (no record must have been returned).Dim exp As String = "(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d"Dim sql As String = ""Dim DATE_EXP As System.Text.RegularExpressions.Match = System.Text.RegularExpressions.Regex.Match(e.Text, exp)sql = "SELECT NAMECOLUMNS from TABLE " If DATE_EXP .Success Then sql += " where CONVERT(VARCHAR(12),DATE_COLUMN,103) = CONVERT(VARCHAR(12), '" & e.Text & "', 103) " Else sql += " WHERE OTHERCOLUMN LIKE '%" + e.Text + "%'" End If SessionDataSource1.SelectCommand = sql