Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
107 views
Hi all

If i use scrolling = "true" in my radgrid flickering of grid and page is happening .
How i avoid page flickering if use scrolling="true"

Thanks for any help.
Pavlina
Telerik team
 answered on 03 Mar 2009
1 answer
103 views
... is it possible to replicate your Insert Code option in the forums within the radEditor?

I'm writing a Knowledge Base system and the ability to insert and maintain formatted code would be really valuable!
Tervel
Telerik team
 answered on 03 Mar 2009
1 answer
148 views
Hi,

I have placed 4 rad combobox in a tooltip. when the tooltip is opening i can see the combobox but on clicking on that the list is going behind the tooltip intead of on tooltip.

Code for aspx :

 

<telerik:RadToolTip ID="RadToolTipFilter" Skin="Vista" runat="server" Modal="true"

 

 

Title="Filters" ManualClose="False" Position="Center" RelativeTo="BrowserWindow"

 

 

OnClientBeforeHide="OnClientBeforeHide" >

 

 

<asp:Panel runat="server" ID="tooltipPan" >

 

 

<table cellpadding="0" border="0" cellspacing="10" style="width: 450px">

 

 

<tr id="trcbSpecialty" runat="server" visible="false">

 

 

<td style="width: 200px;" align="left">

 

 

&nbsp;<asp:Label ID="lblcbSpecialty" CssClass="myLabel" runat="server" Text="Specialty:"></asp:Label>

 

 

</td>

 

 

<td style="width: 200px;" align="left">

 

 

<telerik:RadComboBox ID="cbSpecialty" EmptyMessage="Select" runat="server" Skin="Vista"

 

 

Width="188px">

 

 

<ItemTemplate>

 

 

<div id="div1">

 

 

<telerik:RadTreeView ID="treecbSpecialty" runat="server" CheckBoxes="True">

 

 

</telerik:RadTreeView>

 

 

</div>

 

 

</ItemTemplate>

 

 

<Items>

 

 

<telerik:RadComboBoxItem runat="server" />

 

 

</Items>

 

 

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

 

</telerik:RadComboBox>

 

 

</table>

 

 

</asp:Panel>

 

 

</telerik:RadToolTip>

 

Tsvetie
Telerik team
 answered on 03 Mar 2009
1 answer
194 views
Hello,

I have thoroughly looked through the online help for how to create GridTemplateColumns programmatically and have been successful in doing so.  My whole goal is to have a GridTemplateColumn whose ItemTemplate just shows a value (Employee Name), and whose EditTemplate has a RadComboBox with a MultiColumnDropdown.  I assumed I had to use a template column for this because I didn't see any way to do this with a GridDropDownColumn.  

My grid is tied to an ObjectDataSource that is tied to a DataTable stored as a session variable.

Initially, the data loads fine and everything looks good.  Unfortunately, when I advance to another grid page after the inital load of the web form, the values in the GridTemplateColumn disappear while the other non-template bound columns correctly display data for the next page.

I notice that when I hookup the DataBinding event on the InstantiateIn method, it is called for each row in the page on the initial load of the form.  This is NOT called again after moving to another grid page.  Maybe the trick here is to get that event to fire on a page change, or maybe it's something else? Anyway, here is the code how I'm generating the column.  I have tried to move the loading of the grid into the Page_Init function instead of the Page_Load, but to no avail.  Your help is greatly appreciated!

This method "remakes" an already created bound column into a GridTemplateColumn.  I do this so I can call it generically all over our application.  NOTE that I only have the ItemTemplate at the moment.
Public Sub SetMutliColumnDropDown(ByVal ColumnName As String, ByVal dt As DataTable, ByVal HeaderText As String, ByVal ValueField As String, ByVal TextField As String, ByVal HiddenColumns As String) 
        Session("dd" & ColumnName) = dt 
        Dim ColIndex As Integer = RadGrid1.MasterTableView.Columns.IndexOf(RadGrid1.MasterTableView.Columns.FindByUniqueName(ColumnName)) 
        RadGrid1.MasterTableView.Columns.Remove(RadGrid1.MasterTableView.Columns.FindByUniqueName(ColumnName)) 
 
        Dim col As New GridTemplateColumn() 
        RadGrid1.MasterTableView.Columns.AddAt(ColIndex, col) 
        col.ItemTemplate = New MultiColumnDropDownItemTemplate(dt, ValueField, TextField, HiddenColumns) 
        col.UniqueName = ValueField 
    End Sub 


ItemTemplate class.  
Public Class MultiColumnDropDownItemTemplate : Implements ITemplate 
    Private dt As DataTable 
    Private ValueField As String 
    Private TextField As String 
    Private HiddenColumns As String 
 
    Public Sub New(ByVal dt As DataTable, ByVal ValueField As String, ByVal TextField As String, ByVal HiddenColumns As String) 
        Me.dt = dt 
        Me.ValueField = ValueField 
        Me.TextField = TextField 
        Me.HiddenColumns = HiddenColumns 
    End Sub 
 
    Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn 
        Dim lc As New Literal 
        lc.Text = ValueField 
        AddHandler lc.DataBinding, AddressOf TemplateControl_DataBinding 
        container.Controls.Add(lc) 
    End Sub 
 
    Public Sub TemplateControl_DataBinding(ByVal sender As Object, ByVal e As EventArgs) 
        Dim lc As Literal = CType(sender, Literal) 
        Dim container As GridDataItem = lc.NamingContainer 
        Dim pk As Object = DataBinder.Eval(container.DataItem, lc.Text) 
        For Each row As DataRow In dt.Rows 
            If row(ValueField).ToString = pk.ToString Then 
                lc.Text = row(TextField) 
                Exit For 
            End If 
        Next 
    End Sub 
End Class 

Yavor
Telerik team
 answered on 03 Mar 2009
1 answer
99 views
we have a multi language project, so i need to set the columns headertext dynamicaly.

So what is the problem.
I cannot use server-side oncolumncreated because i am using client-side databinding with paging. I wrote a script like this for the client-side event.
My question is: How can i assign the text for rowheader ?
I used this column.get_parent().headerRow but i know this isnt the right one, and i couldnt found the correct one. If someone can give an answer for this i will be happy.

Regards...

function ColumnCreated(sender, eventArgs) 
    { 
        var column = eventArgs.get_column(); 
 
        if (column.get_dataField() == "RET_CODE"
             column.get_parent().headerRow = '<%= Messages.GetMessage(1112) %>'
        if (column.get_dataField() == "RET_DELIVERYNAME"
            column.get_parent().headerRow = '<%= Messages.GetMessage(1442) %>'
        if (column.get_dataField() == "RET_DELIVERY_ADDRESS"
            column.get_parent().headerRow = '<%= Messages.GetMessage(1398) %>'
        if (column.get_dataField() == "RET_CONTACTNAME"
            column.get_parent().headerRow = '<%= Messages.GetMessage(1029) %>'
        if (column.get_dataField() == "RET_PHONE"
            column.get_parent().headerRow = '<%= Messages.GetMessage(1031) %>'
        if (column.get_dataField() == "CL_STATUS"
            column.set_visible(false); 
    } 

Yavor
Telerik team
 answered on 03 Mar 2009
3 answers
312 views
I have a simple "State" dropdown where the text values of items are the abbreviations of States (e.g. "VA").  I allow the user to type in a custom value because I didn't want to put a "Select State" kind of option but want to use filtering.  Anyway, user types in "va" and the client-side "findItemByText" does not find the item for "VA".  Is there any way to get this method to NOT be case sensitive?
Veselin Vasilev
Telerik team
 answered on 03 Mar 2009
1 answer
122 views
Been trying to find a way all weekend to get the RadUpload control to work in a tooltip.  I understand the Ajax limitation, and have been trying to figure out a way to disable the ajax call that the tooltip makes but can not figure out how.  Does anyone know if it can be done? 

Basically I have a tooltip that shows with LoadOnDemand that contains a RadUpload control.

Thanks..

Jason
Tervel
Telerik team
 answered on 03 Mar 2009
3 answers
154 views
Hello,
I am trying to get a combobox in Edit form as a template.
Firstly I have a RadGrid in that there is a combobox.I binded that successfully.
Upto here there is no problem.But now I have a Edit template form which opens on click of update button.
Here I have two textbox and a combo as a template.I want to show all values in Edit combo that are present in grids combo.I can fetch that again from a database.But the selected value should be same as Grid's combo's selected value.
How to do that.I tried by findcontrol method.I am getting correct combo from edit form.
But when I bind that to database I am not getting.


my Error:

Add Event Listener is null or not an object



My ASPX:

Combobox1 for grid
Combobox2 for Edit Template.

<EditFormSettings EditFormType="Template">

<EditColumn UniqueName="EditCommandColumn1"></EditColumn>

 

                    <FormStyle BackColor="#ECFED8" />

                    <FormTemplate>

                        <table id="Table1" cellspacing="1" cellpadding="1" width="250" border="0">

                            <tr>

                                <td>

                                </td>

                                <td>

                                </td>

                            </tr>

                            <tr>

                                <td>

                                    Employee_Name:</td>

                                <td>

                                    <asp:TextBox ID="TextBox10" Text='<%# Bind( "Employee_Name") %>' runat="server">

                                    </asp:TextBox></td>

                            </tr>

                            <tr>

                                <td>

                                    Designation:</td>

                                <td>

                                    <asp:TextBox ID="TextBox11" Text='<%# Bind( "Employee_Designation") %>' runat="server">

                                    </asp:TextBox></td>

                            </tr>

                            <tr><telerik:RadComboBox  ID="RadComboBox3" runat="server"></telerik:RadComboBox>

                                   </tr></td></td>

                            </tr>

                        </table>

                        <table style="width: 100%">

                            <tr>

                                <td align="right" colspan="2">

                                    <asp:Button ID="Button1" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'

                                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>

                                    </asp:Button>&nbsp;

                                    <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">

                                    </asp:Button>

                                </td>

                            </tr>

                        </table>

                    </FormTemplate>

                </EditFormSettings>

CS


 

 protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)

 {

 

     if (e.Item is Telerik.Web.UI.GridDataItem)

     {

 

         Telerik.Web.UI.RadComboBox cmb = (Telerik.Web.UI.RadComboBox)e.Item.FindControl("RadComboBox1");

         SqlConnection = new SqlConnection("Server=ma;DataBase=Test;User=sa;Password=");

         SqlDataAdapter da = new SqlDataAdapter("Select Employee_Id from Employee_Master", SqlConnection);

         DataTable dt1 = new DataTable();

         da.Fill(dt1);

         //string[] options = { "OptionA", "OptionB", "OptionC" };

         cmb.DataSource = dt1;

         cmb.DataMember = "Employee_Id";

         cmb.DataTextField = "Employee_Id";

         //cmb.SelectedIndex = i;

         cmb.DataBind();

         cmb.SelectedItem.Text = dt1.Rows[i]["Employee_Id"].ToString();

         i++;

 

     }

     if (e.Item is GridEditFormItem && e.Item.IsInEditMode)

     {                        

         //GridEditFormItem editFormItem = e.Item as GridEditFormItem;

         //GridDataItem parentItem = editFormItem.ParentItem;

         //Telerik.Web.UI.RadComboBox box = editFormItem.FindControl("RadComboBox3") as Telerik.Web.UI.RadComboBox;

         SqlConnection = new SqlConnection("Server=ma;DataBase=Test;User=sa;Password=");

         SqlDataAdapter da1 = new SqlDataAdapter("Select Employee_Id from Employee_Master", SqlConnection);

         DataTable dt1 = new DataTable();

         da1.Fill(dt1);

         //box.DataTextField = parentItem["Employee_Name"].Text;

         //box.DataSource = dt1;

         //box.DataMember = "Employee_Id";

         //box.DataTextField = "Employee_Id";

         GridEditFormItem formItem = (GridEditFormItem)e.Item;

         RadComboBox dropdown = (RadComboBox)formItem.FindControl("RadComboBox3");

         dropdown.DataSource= dt1;

         dropdown.DataTextField = "Employee_Id";

         dropdown.DataValueField = "Employee_Id";

         dropdown.SelectedValue = DataBinder.Eval(formItem.DataItem, "Employee_Id").ToString();

 

 

     }

 


Thanks in advance,
-Mahesh
Yavor
Telerik team
 answered on 03 Mar 2009
3 answers
171 views
Hi Friends,
    i am using radgrid to display some records which includes date filed also.
   
    In the grid i have provider filter option in the command item template as specified below

<telerik:GridTemplateColumn HeaderStyle-Width="75px" HeaderText="Modified" ItemStyle-Width="75px" UniqueName="Modified">
    <ItemTemplate>
    <asp:Label ID="lblModified" runat="server" Text='<%# iif(Eval("Modified") & "" <> "",format(Eval("Modified"),"MM/dd/yyyy"),"")  %>'></asp:Label>
    </ItemTemplate>
</telerik:GridTemplateColumn>
'-------------------------------------------------------------------------------------------------------------------------
    <CommandItemTemplate>
    <asp:TextBox  autocomplete="off"  ID="txtSearch" runat="server" EnableTheming ="true"></asp:TextBox>
    <telerik:RadCombobox ID="rcbFieldName" runat="server" AllowCustomText="True"
        <Items>
            <telerik:RadComboBoxItem Text="Name" Value="StructureName LIKE '%-VALUE-%'" />
            <telerik:RadComboBoxItem Text="Description" Value="Description LIKE '%-VALUE-%'" />
            <telerik:RadComboBoxItem Text="Created" Value="Created LIKE %-VALUE-%'" />
            <telerik:RadComboBoxItem Text="Modified" Value="Modified LIKE '%-VALUE-%'" />
        </Items>
        <collapseanimation duration="200" type="OutQuint"></collapseanimation>
    </telerik:RadCombobox>
</CommandItemTemplate>
'----------------------------------------------------------------------------------------------------------

Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
            Case "FilterUsersBy"
                Dim txtSearch As TextBox = CType(e.Item.FindControl("txtSearch"), TextBox)
                Dim rcbFieldName As RadComboBox = CType(e.Item.FindControl("rcbFieldName"), RadComboBox)
                RadGrid1.MasterTableView.FilterExpression = Replace(rcbFieldName.SelectedValue, "%-VALUE-%", txtSearch.Text)
                RadAjaxManager1.Alert(RadGrid1.MasterTableView.FilterExpression.ToString)
                RadAjaxManager1.Alert(RadGrid1.MasterTableView.e
                RadGrid1.MasterTableView.Rebind()
         End Select
end sub

my search for date is not working (but for the othere 2 fileds its working fine)
i am not sure whether the code is wrong or the input for search i am providing is wrong

wht is the format i have to search for date '02/21/2009' or '02/21/2009  00:00:00.000'

can any one plzzz help me........

Thanx in advance
K²



 
Yavor
Telerik team
 answered on 03 Mar 2009
1 answer
168 views
I have a table that I want to expand the row and display the Detail Table when the row is clicked by the user.  I achieve that like so:
If e.CommandName = "RowClick" Then 
            Dim item As GridDataItem = e.Item 
            If item.Expanded = True Then 
                item.Expanded = False 
            Else 
                item.Expanded = True 
            End If 
        End If 

However I get an error on the "item.expanded = true"

Procedure or function 'sp_Select_Affiliate_Purchased_Breakdown' expects parameter '@source_id', which was not supplied.

<asp:SqlDataSource ID="sqlds_AffiliatePurchasedData" runat="server"  
        ConnectionString="<%$ ConnectionStrings:Company_Master_ConnectionString %>"  
        SelectCommand="sp_Select_Affiliate_Purchased_Breakdown"  
        SelectCommandType="StoredProcedure"
        <SelectParameters> 
            <asp:Parameter Name="source_id" Type="Int32" DefaultValue="@source_id" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 

Why would this be happening?  The Parameter is right in the data source...




Shinu
Top achievements
Rank 2
 answered on 03 Mar 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?