Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
202 views
Hi

I've tried to use this example Multi-selection radcombobox in a project, but I have run in to a  problem because my case differs a bit from the example code.

My gridview is bound to a custom collection of Chemical objects. The Chemical object have a sub-property ChemicalLabels collection of which each item is bound to a gridcolumn as a commaseparated string.

How can I set the filterexpression in the gridview, so that it only shows object with chemicallabels selected in the radcombobox?

The filterexpression used in the example is: (it[\"ShipCountry\"].ToString().Contains(\"" + item.Text + "\")) but this does not work with my custom collection. 
Eyup
Telerik team
 answered on 20 Feb 2013
2 answers
157 views
Hi,

I want to update the ViewPaths depending on login usernames. So each username will have different ViewPaths location. I tried the following code but it does not not work, the ViewPaths does not change. Please help me.

private void ChangeServerPath(string folderPath)
{
    string[] path = new[] { folderPath };
    fileExplorer.Configuration.ViewPaths = path;
    fileExplorer.Configuration.UploadPaths = path;
    fileExplorer.Configuration.DeletePaths = path;
    fileExplorer.TreeView.DataBind();
    fileExplorer.DataBind();
}

Thank you,
Khoa
Dobromir
Telerik team
 answered on 20 Feb 2013
3 answers
89 views
I've done a lot of searching and have not found exactly my issue. Most of the "multiple rows" involve putting multiple rows in a single column. I need entire second rows.

At a high level this is my dilemma. I get a row of data back. Sometimes this row has warnings associated with it. The business wants those warnings to be displayed in a full row below the row of data. It has to be always visible. In addition we currently use the expander to show additional details about the row.

I've had a few thoughts.on how to do this. The first is to use the OnPreRender method that we are using to add a second header row . I think this might work but I can see it getting pretty ugly since I'll be dealing with the grid as a whole rather than one row at a time. The second idea is to use two DetailTables, one for the warnings and one for the additional detail. The problem with this is that I don't think there would be a way to open one detail table, close the other but have the expander say "closed" so it behaves "normally". My third idea is to somehow leverage a NestedViewTemplate to finagle this. I think this would suffer the same fate as my second idea.

Has anyone done this before? Any advice or help in how I should proceed would be greatly appreciated!

/Rob
Daniel
Telerik team
 answered on 20 Feb 2013
1 answer
87 views
Has there been in progress in addressing the issue with only 30 days showing in March in month view? In 2013 it only shows 29 days in month view. 

http://demos.telerik.com/aspnet-ajax/scheduler/examples/overview/defaultcs.aspx


UPDATE*** After debugging locally I have noticed if you disable the timezone features all the days appear correctly. 
Boyan Dimitrov
Telerik team
 answered on 20 Feb 2013
1 answer
216 views
I am using RadGrid. i am binding another grid , when i click on a row.And selected row color is "#FF9B35". if i click on this row again, it's color should be different and second grid should bind with another or you can say second gird should release.
I an working on its selectedIndexChanged event.  

And the problem is that "if i click already selected row , its selectedIndexChanged event is not firing".

you can see snapshot also.

Please help . Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 20 Feb 2013
2 answers
185 views
I used the Combobox/Template example to build a RadComboBox with a RadTreeView as an ItemTemplate, but instead of a SqlDataSource I bound the tree in C# using a List<object>. The same tree works fine when it is by itself and shows all the data correctly, but when it is inside of the Item it is BLANK - the drop down is empty.

this is my front end code:
<telerik:RadComboBox
    ID="rcbDrawing"
    Width="205px"
    Height="300px"
    AllowCustomText="true"
    EmptyMessage="Select A Drawing"
    runat="server"
    Skin="Outlook"
    >
    <ItemTemplate>
        <div onclick="StopPropagation(event)">
            <telerik:RadTreeView
                ID="treeDrawings"
                runat="server"
                DataTextField="Name"
                DataValueField="ID"
                DataFieldID="ID"
                DataFieldParentID="ParentID"
                Skin="Outlook"
                OnClientNodeClicking="OnTreeNodeClicking"
                ></telerik:RadTreeView>
        </div>
    </ItemTemplate>
    <Items>
        <telerik:RadComboBoxItem />
    </Items>
</telerik:RadComboBox>


This is how I do the binding:
RadTreeView treeDrawings = (RadTreeView)rcbDrawing.Items[0].FindControl("treeDrawings");
DrawingsCollection d = DrawingsCollection.GetByClientID(PageUser);
treeDrawings.DataSource = d;
treeDrawings.DataBind();
treeDrawings.ExpandAllNodes();

Am I doing anything wrong?
Ivan Zhekov
Telerik team
 answered on 20 Feb 2013
1 answer
169 views
Hi,
I created a  skin for telerik controls by using http://stylebuilder.telerik.com/ and downloaded as zip file. then convert it as dll by using  a toll got from http://www.telerik.com/community/forums/aspnet-ajax/style-builder/tool-for-embedding-custom-skins-into-an-assembly.aspx , TELERIK ADMIN POST SECTION(First Post).  The converted dll referenced to my project. In my page, using skin chooser (including your default skins and my custom skin)and change the skin at run time.  But when i choosing my custom skin it show the below error message.


Telerik.Web.UI.RadFormDecorator with ID='RadFormDecorator1' was unable to find an embedded skin with the name 'TelerikSkins'. Please, make sure that the skin name is spelled correctly and that you have added a reference to the Telerik.Web.UI.Skins.dll assembly in your project. If you want to use a custom skin, set EnableEmbeddedSkins=false. 


I can' t set  

EnableEmbeddedSkins=false.Because i need to set any skin from the skin chooser at run time.



What i do?.
Princy
Top achievements
Rank 2
 answered on 20 Feb 2013
2 answers
112 views
<telerik:RadGrid ID="RadGridQuotes" runat="server" OnNeedDataSource="RadGridQuotes_NeedDataSource"
    PageSize="15" EnableAjax="True" OnItemDataBound ="RadGridQuotes_ItemDataBound" >
    <MasterTableView ShowFooter="true" DataKeyNames="ID">
        <Columns>
            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" DataType="System.Int32" ItemStyle-Width="50" HeaderStyle-Width="50" />
            <telerik:GridBoundColumn DataField="Views" HeaderText="Views" DataType="System.Int32" ItemStyle-Width="40" HeaderStyle-Width="40" />
            <telerik:GridBoundColumn DataField="ClientID" HeaderText="ClientID" DataType="System.Int32" ItemStyle-Width="50" HeaderStyle-Width="50"  />
            <telerik:GridBoundColumn DataField="Name" HeaderText="Name" DataType="System.String" ItemStyle-Width="200" HeaderStyle-Width="200"/>
            <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="EmailAddress" DataType="System.String" />
            <telerik:GridBoundColumn DataField="Sex" HeaderText="Sex" DataType="System.String" ItemStyle-Width="40" HeaderStyle-Width="40"/>
            <telerik:GridBoundColumn DataField="PhoneNumber" HeaderText="PhoneNumber" DataType="System.String" />
            <telerik:GridBoundColumn DataField="Inserted" HeaderText="Inserted" DataType="System.DateTime" DataFormatString="{0:dd-MM-yyyy}" />
            <telerik:GridBoundColumn DataField="Type" HeaderText="Type" DataType="System.String"  ItemStyle-Width="70" HeaderStyle-Width="70" />
            <telerik:GridCheckBoxColumn DataField="IsTransfer" UniqueName="IsTransfer" HeaderText="IsTransfer" DataType="System.Boolean"  ItemStyle-Width="70" HeaderStyle-Width="70" />
            <telerik:GridCheckBoxColumn DataField="IsOther" HeaderText="IsOther" DataType="System.Boolean"  ItemStyle-Width="70" HeaderStyle-Width="70" />
            <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="120" UniqueName="DownloadQuoteButton">
                <ItemTemplate>
                    <asp:Button ID="ButtonOpen" runat="server" CausesValidation="false" OnClick="ButtonOpen_OnClick"
                        CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID")%>' Text="Open Quote" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="NULL" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


Now I want to disable (Visible = false) the asp-button like this;

if (column["IsTransfer"] == true && column["IsOther]== true)
{
ButtonOpen.Visible = false;
}

I don't see how to access the button and how I check these column cell-values
Pascal
Top achievements
Rank 1
 answered on 20 Feb 2013
5 answers
1.2K+ views

Hi ,

I would like to hide the column of the radgrid based on value selected from dropdown. Following is the code.
On selectedIndexChanged i am finding the column and hiding.
For the first time works fine. When i select other, column is getting hidden but when i selected any other option,
 hidden column is not coming up even though i have made visible is true.

Do i need to do any other things.
Can u help me on this . ???

Regards,
Akki


<telerik:GridTemplateColumn UniqueName="group">
                            <HeaderTemplate>
                                <span class="errCopy">*</span>
                                <asp:Label ID="lblGrp" runat="server" Text="Group"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:DropDownList ID="ddlGrp" runat="server" Width="100%" CssClass="textCopy"
                                AutoPostBack="true" OnSelectedIndexChanged="ddlGrp_SelectedIndexChanged">
                                </asp:DropDownList>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="description">
                            <HeaderTemplate>
                                <asp:Label ID="lblDesc" runat="server" Text="Description,if Group"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="txtBxDesc" runat="server" Width="100%" CssClass="textCopy"
                                    MaxLength="100">
                                </asp:TextBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>



protected void ddlGrp_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList ddlSender = (DropDownList)sender;
            GridDataItem editForm = (GridDataItem)ddlSender.NamingContainer;
            DropDownList ddlAudGrp = (DropDownList)editForm.FindControl("ddlGrp");
            string abc = ddlAudGrp.SelectedItem.Text;
            if (abc == "Other")
            {
                rdGrp.MasterTableView.GetColumnSafe("group").Visible = true;
            }
            else
            {
                rdGrdAudienceGrp.MasterTableView.GetColumnSafe("group").Visible = false;
            }

             
        }

Akki
Top achievements
Rank 1
 answered on 20 Feb 2013
2 answers
147 views
I am creating my RadGrid programmatically in the Page_Init. During the process I am creating a GridTemplateColumn that will be used as a CheckBox. I am doing this to convert my database value to a boolean. I have also added an attribute to the checkbox so that when they click the checkbox I want to run some javascript. In that javascript I would like to gather some of the values in the other cells on the row of the checkbox I just clicked in. So say I have 5 columns in my grid, the third column has checkboxes and there are a total of 100 rows. When I click the checkbox of the the third row, I want to gather the values of all 5 columns for the row of the checkbox I clicked. I see a lot of Client-side scripting methods but unfortunately am new to the RadGrid. I did set the OnGridSelected to a javascript function to get the RadGrid object but that is as far as I know how to go. Please let me know.

RadGrid1.ClientSettings.ClientEvents.OnGridCreated =

 

"GetGridObject"

 

 

 

var RadGrid1;

 

 

 

function GetGridObject(sender, eventArgs)

 

{

RadGrid1 = sender;

}

 

 

 

 

 

Public Class MyTemplate
    Implements ITemplate
    Protected textBox As TextBox
    Protected boolValue As CheckBox
    Private colname As String
    Public Sub New(ByVal cName As String)
        colname = cName
    End Sub
    Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
        boolValue = New CheckBox()
        boolValue.ID = colname
        AddHandler boolValue.DataBinding, _
                   AddressOf boolValue_DataBinding
        boolValue.Enabled = True
        container.Controls.Add(boolValue)
    End Sub
    Sub boolValue_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
        Dim cBox As CheckBox = DirectCast(sender, CheckBox)
        Dim container As GridDataItem = DirectCast(cBox.NamingContainer, GridDataItem)
        If ((DirectCast(container.DataItem, DataRowView))(colname)) = 1 Or ((DirectCast(container.DataItem, DataRowView))(colname)) = True Then
            cBox.Checked = True
        Else
            cBox.Checked = False
        End If
        cBox.Attributes.Add("onClick", "Javascript:fnOpenGeoInfoView('')")
    End Sub
    Sub textBox_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
        Dim cTextBox As TextBox = DirectCast(sender, TextBox)
        Dim container As GridDataItem = DirectCast(cTextBox.NamingContainer, GridDataItem)
        cTextBox.Text = (DirectCast(container.DataItem, DataRowView))(colname).ToString()
    End Sub
End Class

Eyup
Telerik team
 answered on 20 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?