Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
100 views
Hey,
I'm working on fileExplorer control to upload files which I need to save their metadata in a DataBase, so upon uploading I need to call some methods to do that, but I can't figure out the event that triggers onUploading please can you help me?
Dobromir
Telerik team
 answered on 21 Jul 2011
2 answers
78 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
69 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
381 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
60 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
158 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
81 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
115 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
94 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
146 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?