Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
67 views
I have a radgrid which uses form templates for updating records in the grid. I also need to use this form to update multiple rows in the grid at the same time (global updates). I have a gridclientselect column and the code behind inplace to successfully do the update for multiple selected rows. I am running into one small problem which I need help. The checkboxes clear upon opening the edit form. The correct information is saved in RadGrid1.SelectedItems, but I am failing to understand why the checks are removed from the gridclientselectcolumn field. Is there a way to keep the items selected until the form is closed?

Please let me know if you need code snippets to help answer this question.

Thanks a bunch!
Casey
Top achievements
Rank 1
 answered on 21 Jul 2011
0 answers
58 views
UPDATE: fixed by moving popup into a user control and setting z-index on this, very odd but works fine :-)




I have 3 divs on a page, one contains a list of blog entries, another a tag cloud and another (hidden) shows a dialog for entering a new blog.

The new blog div opens up using jQuery .fadeIn method on top of the rest of the page.  The blog content is entered using a Rad Editor but the tag cloud is still visible through the editor even though I've tried changing the z-index of the components accordingly...

Hope this makes sense and somebody can replicate this, or point me in the direction of an answer...

I've even tried .hide on the tag cloud but it still appears...
Cliff Gibson
Top achievements
Rank 1
 asked on 21 Jul 2011
1 answer
349 views
I'm attempting to have the new RadComboBox with checkboxes="true" bound to a SqlDataSource inside a radGrid. 

It works fine when just 1 item is selected, but when I select multiple Items it doesn't work. I try to convert all the selected countries ids into a comma separated string and then add an updateparameter to update the database.  But it doesn't update it. I'm not sure what I'm doing wrong. 

I'll also like to know the proper way to populate the checkboxes in the radcombobox automatically, when editmode is enabled on the grid.

<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 Function

Kalina
Telerik team
 answered on 21 Jul 2011
1 answer
41 views
Hi there,

I am trying to use the Gantt Chart to bind to a custom DataSource.  I then want the click event to navigate to a new URL (passing in the ID of the element that has been clicked).  Using ActiveRegionUrl='<%# Eval("RecordId", "campaignviewer.aspx?CampaignID={0}") %>' I get a message about the ChartSeries not having a DataBind method.

I have also tried this by interrogating the ClickEventArgs on click, but cannot seem to get any sensical information from it (or set anything for that matter).

Finally, I tried it without using automatic databinding as follows:

foreach (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);
}

However in this way, I cannot set the label for each row and I also see a load of empty rows (labelled from 1 - 10).

Any help would be gratefully appreciated!

Alec.
Tsvetie
Telerik team
 answered on 21 Jul 2011
1 answer
137 views
Hi All,

We have a FileExplorer in our application which is built dynamicallly. On click of a tree node, we are trying to rebind the grid with the value of the node clicked. The datasource of the grid has the updated data but after the code passes rebind statement, the grid still holds the old value. Below is our PopulateGrid() method and it is invoked in OnPreRender.

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

Dobromir
Telerik team
 answered on 21 Jul 2011
1 answer
65 views
Hi,

      I need to customize .RadInput css on my content page.
    

 

    <style type="text/css">

 

 

        .RadInput

 

        {

 

            display: none;

 

        }

 

    </style>

 



 I'm able to achieve what I want. But I also have a Radtextbox on my master page. when this page loads, master page's textbox also disappears. Is there some way I could restrict this modified css's efect to content page?

Thanks
Rajesh
Slav
Telerik team
 answered on 21 Jul 2011
0 answers
94 views

I have a stand alone form used for time entry.  i display entries in a radgrid.  intead of using the pop up edit form, I just want to prefill some values in my user control to do the edit.   I cannot seem to find the control with this code.  i have definitely verified the names are correct.  It says  u  is nothing then errors when I try to find a drop down list.

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
David
Top achievements
Rank 1
 asked on 21 Jul 2011
0 answers
78 views
First excuse my english. I have a grid in my page and a method in a WCF Data Service:

<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();
}

I have 2 problems:
1-  When the 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.

2.- The grid contains 5 records with 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).

Where is the problem?, Maybe the culture or the DataFormatString?. I've been looking in Google but I can get no answer.

Thanks in advance.
Iker Llanos
Top achievements
Rank 1
 asked on 21 Jul 2011
0 answers
127 views
Hi everyone!
I'm from brazil so i don't speak english very well... sorry! :-\
I have a little problem here..
When a put a date in RadCombo to used autocomplete function it bring me result but not to show anything...
It show me result only if i put a string (word..etc..)
Why?

My search code:

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
 

										
Jorge
Top achievements
Rank 1
 asked on 21 Jul 2011
1 answer
118 views
Hello

My page use Gird to paging, http://www.vuakiengmiennam.com. My page show all product and have 2 page. I click Page 2, it not run and show error, i have attach file. Please help me. I use both Firefox and IE

 <div id="menubody">
          
                            <uc1:menu ID="menu1" runat="server" />
                       
            

            </div>
 <div id="products">        
     
     <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
     </telerik:RadScriptManager>
   
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                <AjaxSettings>
                     <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                     <UpdatedControls>
                     <telerik:AjaxUpdatedControl ControlID="RadGrid1"/>
                     </UpdatedControls>
                     </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1"/>
                            
                        </UpdatedControls>
                        </telerik:AjaxSetting>
                    
                  
                                                        
                </AjaxSettings>
            </telerik:RadAjaxManager>
          
          
      
          
           <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1"
            runat="server" GridLines="None" AllowPaging="True" OnPreRender="RadGrid1_PreRender"
            PageSize="9" CellSpacing="0" ShowHeader="False" Width="555px"
         BorderWidth="0px">
            <PagerStyle Mode="NextPrevAndNumeric" />
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>

               <FooterStyle BorderWidth="0px" />
               <AlternatingItemStyle BorderWidth="0px" />

               <ItemStyle BackColor="#1A8218" BorderWidth="0px" />

            <MasterTableView TableLayout="Fixed" ForeColor="#003300" BorderWidth="0px"
                   HorizontalAlign="NotSet" AutoGenerateColumns="False">
                <ItemTemplate>
                    <%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %>
                    <asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>'
                        runat="server">
                         <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" DataValue='<%# Eval("Hinh")%>' Width="150" Height="100" ResizeMode="Crop" />
                       <br />
                        <b>Tên:</b>
                        <%# Eval("Tencay")%>
                        <br />
                        <b>Giá</b>
                        <%# Eval("Gia")%>
                        <br />
                        <b>CK:</b>
                        <%# Eval("Huehong")%>  <a href="dproducts.aspx?idcay=<%# Eval("id") %>" ><img src="images/chitiet.gif"/ border="0px"></a></asp:Panel>
                </ItemTemplate>

<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
    <HeaderStyle BorderWidth="0px" />
    <ItemStyle BorderWidth="0px" />
                </RowIndicatorColumn>

<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>

                <Columns>
                    <telerik:GridBoundColumn DataField="id" DataType="System.Int32"
                        FilterControlAltText="Filter id column" HeaderText="id" SortExpression="id"
                        UniqueName="id">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="idloaicay" DataType="System.Byte"
                        FilterControlAltText="Filter idloaicay column" HeaderText="idloaicay"
                        SortExpression="idloaicay" UniqueName="idloaicay">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Tencay"
                        FilterControlAltText="Filter Tencay column" HeaderText="Tencay"
                        SortExpression="Tencay" UniqueName="Tencay">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Gioithieu"
                        FilterControlAltText="Filter Gioithieu column" HeaderText="Gioithieu"
                        SortExpression="Gioithieu" UniqueName="Gioithieu">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Gia"
                        FilterControlAltText="Filter Gia column" HeaderText="Gia" SortExpression="Gia"
                        UniqueName="Gia">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Huehong"
                        FilterControlAltText="Filter Huehong column" HeaderText="Huehong"
                        SortExpression="Huehong" UniqueName="Huehong">
                    </telerik:GridBoundColumn>
                    
                    <telerik:GridBoundColumn DataField="Ngaycapnhat" DataType="System.DateTime"
                        FilterControlAltText="Filter Ngaycapnhat column" HeaderText="Ngaycapnhat"
                        SortExpression="Ngaycapnhat" UniqueName="Ngaycapnhat">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Trangthai"
                        FilterControlAltText="Filter Trangthai column" HeaderText="Trangthai"
                        SortExpression="Trangthai" UniqueName="Trangthai">
                    </telerik:GridBoundColumn>
                </Columns>

<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
                <ItemStyle BackColor="#009933" BorderColor="#009933" BorderWidth="0px" />
                <AlternatingItemStyle BorderWidth="0px" />
                <HeaderStyle BackColor="#339966" />
            </MasterTableView>
               <HeaderStyle BorderWidth="0px" />
            <GroupingSettings CaseSensitive="false" />

               <GroupHeaderItemStyle BorderWidth="0px" />

<FilterMenu EnableImageSprites="False"></FilterMenu>
               <EditItemStyle BorderWidth="0px" />
               <ActiveItemStyle BorderWidth="0px" />
               <CommandItemStyle BorderWidth="0px" />
        </telerik:RadGrid>
          
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                        ConnectionString="<%$ ConnectionStrings:vuakiengmiennamConnectionString %>"
                        
                        SelectCommand="sp_showcaykiengtheoloai"
         SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:QueryStringParameter DefaultValue="0" Name="loaicay" QueryStringField="id"
                                Type="Byte" />
                        </SelectParameters>
                    </asp:SqlDataSource>
Vasil
Telerik team
 answered on 21 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?