Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
96 views
Hi all!

I'm created a custom skin based on the Telerik default Skin. And I have a problem with the border color when choose different DOCTYPE. Please attach the files for details. 

_ In "p2.png", it show exactly the color I chose for grid border. I use
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


But in "p1.png", the border color is totally difference (BLACK). In this case, DOCTYPE  is

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

By the way, I need the "XHTML 1.0 Transitional" for the DOCTYPE.

Need a help from all of you!

Thanks!

Andy.
Andy
Top achievements
Rank 1
 answered on 27 Oct 2010
1 answer
187 views
HI,


Please Help Me,

I am using telerik radgrid in visual studio 2008.i have a telerik radgrid with detailtable can anyone explain how to export all detailsview and mastertable view field.Then i have imagebutton field so i need to avoid that


regards
suresh.S
Pavlina
Telerik team
 answered on 27 Oct 2010
3 answers
463 views
Hi, I am replacing an existing control suite with Telerik and am trying to use the tabstrip to control navigation, with each tab pointing to a .Net page that isn't suitable to be put into a multipage due to complexity.

I found a suggestion in the forums to use an iframe which I have done but I find that when the page is refreshed the selected tab goes back to the first tab and trying to interrogate the iframe src using jquery just seems to bring back the intiailly set src.

Is there a way to persist the selected tab on page refresh?

My code is below.

Thanks, Matt

<telerik:RadTabStrip ID="rtsMainTabs" runat="server" Width="990px"
    CssClass="crmMainTabs" Skin="Simple" SelectedIndex="2">
    <Tabs>                      
        <telerik:RadTab
            NavigateUrl="home.aspx"
            Text="Front Page"
            Target="IFContent">
        </telerik:RadTab>
        <telerik:RadTab
            NavigateUrl="Page2.aspx"
            Text="Page2"
            Target="IFContent">
        </telerik:RadTab>
        <telerik:RadTab
            NavigateUrl="Page3.aspx"
            Text="Page3"
            Target="IFContent">
        </telerik:RadTab>
        <telerik:RadTab
            NavigateUrl="Page4.aspx"
            Text="Page4"
            Target="IFContent">
        </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>
<iframe name="IFContent" id="IFContent" style="width:990px; height:720px;"
src="home.aspx"></iframe>
Cori
Top achievements
Rank 2
 answered on 27 Oct 2010
1 answer
68 views

Hi,

I have used Telerik products specially Radgrid, RadAjaxManager and RadWindow in my project extensively. After everything has started working fine, we are trying to fine tune the project to make it faster as client has started complaining about the speed of certain pages or context menu items.

For a RadGrid, Ihave used RadMenu as contextmenu. For the context menus for which there is no postback, everything works fine. For the context menu with postback, when the server side code is run to check some values in the database and open a new page in a RadWindow depending on the values, it takes a very long time. The reason I figured is – even for an Ajax call, the data submitted to server is the whole grid data and then bring back the whole data. My initial ajaxsetting as shown below was bringing back the whole data and reloading the grid, so it was taking even longer. Now I am not reloading the grid, so it is working a little faster.

 

<telerik:AjaxSetting AjaxControlID="RadMenu1">

            <UpdatedControls>

                <telerik:AjaxUpdatedControl ControlID="Label1"/>

            </UpdatedControls>

        </telerik:AjaxSetting>

Previuosly my ajax setting was

 

<telerik:AjaxSetting AjaxControlID="RadMenu1">

            <UpdatedControls>

                <telerik:AjaxUpdatedControl ControlID="RadGrid1"/>

            </UpdatedControls>

        </telerik:AjaxSetting>

 

When RadGRid1 was the updated control for RadMenu, page was even slower.

Can you please suggest  what can I do to improve the performance?

 

Thanks

 

Pavlina
Telerik team
 answered on 27 Oct 2010
1 answer
205 views

Hi,
I am loading Telerik grid based on search parameters, and when data is loading from database,i would like to display Hourglass rotating, but i could not able to get it. since i am getting default loading rotating only.

ex:-

<

 

telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackColor="AliceBlue"

 

 

 

 

 

Transparency="30">

 

 

 

 

 

<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'

 

 

 

 

 

style="border: 0;" />

 

 

 

 

 

</telerik:RadAjaxLoadingPanel>

 

 

 

do let me know, if i need to change to loading.gif to some other file? if so please let me know the path.

Thanks in advance.

Cori
Top achievements
Rank 2
 answered on 27 Oct 2010
1 answer
65 views
Hello guys, 

i am using a RadAjaxManager on my site to ajaxify some buttons (filter options, multiple selection possible) to filter the content of my RadGrid.

I am also using the EnableHistory Attribute of the RadAjaxManager, to jump back to the previous filter if you are clicking the Previous-Site Button in the Browser.

In Internet Explorer this is working very well. But in Firefox, Chrome or Opera the HistorySteps doesn´t have any effect.

Is there an possibility to get the EnableHistory to work in these browsers or is there any workaround? 

Thanks in advance.

Chris
Maria Ilieva
Telerik team
 answered on 27 Oct 2010
1 answer
78 views
Hello,
I am using RadCombobox in RadGrid . I have 3 item in RadCombobox. 
combobox item:
  1. Item 1
  2. Item 2
  3. Item 3

 

 

In Insert mode ,if I use "Item 1"  in first row. In second row I want to remove "Item 1" from combobox and show "Item 2" and "Item 3" in combobox.  How can I do this?

Thanks
Md Nasir Uddin
Veli
Telerik team
 answered on 27 Oct 2010
1 answer
245 views
I have a GridImageColumn. The image that is displayed is a thumbnail. I would like the user to be able to click the thumbnail to see a larger image. I have the Java to open the image in a new modal window. I have set the clientevent onrowdblclick to open the image. However, if the actuall thumbnail is clicked, the event does not fire. How can I make the onclick event fire when the thumbnail is clicked?

Here is what I have attempted so far with no luck.

<telerik:GridImageColumn AlternateText="Thumbnail" 
DataImageUrlFields="FilePath, ThumbnailName" DataImageUrlFormatString="{0}/{1}" 
DataType="System.String" FooterText="ImageColumn footer" HeaderText="" 
ImageAlign="Middle" UniqueName="vehicleimage">
<HeaderStyle Width="75px" />
</telerik:GridImageColumn>


Protected Sub rg_VehicleImages_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles rg_VehicleImages.ItemCreated
    If TypeOf e.Item Is GridDataItem Then
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim deleteBtn As LinkButton = DirectCast(item.FindControl("AutoGeneratedDeleteButton"), LinkButton)
        deleteBtn.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this image?')")
    End If
    If TypeOf e.Item Is GridDataItem Then
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim cell As TableCell = item("vehicleimage")
        Dim img As Image = TryCast(cell.Controls(0), Image)
        img.Attributes.Add("onclick", "rowclick")
    End If
End Sub

Any help much appreciated.
Marin
Telerik team
 answered on 27 Oct 2010
1 answer
89 views
Hi guys
I have enabled Automatic edit delete and insert in radgrid with sql data source. I have an external filter (radcombo) for filtering radgrid with distinct values of first three columns. Everything is working properly. But my issue is after filtering edit is not working properly. When i click on edit image button on a row in filtered grid i am getting first row in that grid instead of clicked item. I think, when i click on edit button radgrid going back to previous data source. How can I edit that particular clicked row in that grid. Here is my code. Please help anybody to clear this issue.

Ben

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGridOpenItems">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridOpenItems" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGridOpenItems">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridOpenItems" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
              
            </AjaxSettings>
        </telerik:RadAjaxManager>
<telerik:RadComboBox ID="RadComboBox1" runat="server"
                MarkFirstMatch="True" EnableLoadOnDemand="True" AutoPostBack="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

            <script type="text/javascript">
                function RowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
            </script>

        </telerik:RadCodeBlock>

<telerik:RadGrid ID="RadGridOpenItems" runat="server" DataSourceID="SqlDataSourcePwOpenItems" AllowMultiRowEdit="true"
         ShowStatusBar="True" GridLines="None" OnItemUpdated="RadGrid1_ItemUpdated" OnItemInserted="RadGrid1_ItemInserted"
        AllowFilteringByColumn="false" AllowPaging="True" OnItemDeleted="RadGrid1_ItemDeleted"  
    AllowSorting="True" Skin="Vista" AllowAutomaticDeletes="True"  
        AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
        AutoGenerateColumns="False" ShowGroupPanel="false" >
        <ClientSettings Scrolling-AllowScroll="True" AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                <Selecting AllowRowSelect="True" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" FrozenColumnsCount="0" SaveScrollPosition="True" />
                <Resizing AllowColumnResize="True" />
                <ClientEvents OnRowDblClick="RowDblClick" />

                <Selecting AllowRowSelect="True"></Selecting>
                <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
                <Resizing AllowColumnResize="True"></Resizing>
        </ClientSettings>
        <MasterTableView DataSourceID="SqlDataSourcePwOpenItems"
            AllowPaging="True" AllowSorting="True" CommandItemDisplay="Top"
             EditMode="InPlace" DataKeyNames="PWOPENITEMS_ID" AllowAutomaticDeletes="true">
                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
 
 
        <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>

        <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>

        </ExpandCollapseColumn>
      
       
<%--Gridview Columns--%>   
    <Columns>
        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"
            ButtonType="imagebutton" >
            <HeaderStyle Width="35px" />
        </telerik:GridEditCommandColumn>

        <telerik:GridClientDeleteColumn ConfirmText="Are you sure you want to delete the selected row?"
              HeaderStyle-Width="35px" ButtonType="ImageButton" UniqueName="column1" >

        <HeaderStyle Width="35px"></HeaderStyle>
          </telerik:GridClientDeleteColumn>

        <telerik:GridTemplateColumn DataField="OPCODE" HeaderText="OPCODE"
            SortExpression="OPCODE" UniqueName="OPCODE" AllowFiltering="false">
            <HeaderStyle Width="120px" />
<%--Convert to uppercase--%>        
            <EditItemTemplate>
                <asp:TextBox id="txtOpcode" runat="server" Text='<%# Bind("OPCODE") %>' MaxLength="3"
                    Onkeyup="javascript:this.value = this.value.toUpperCase();"></asp:TextBox>
            </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label id="lblOpcode" runat="server" Text='<%# Eval("OPCODE") %>'></asp:Label>
                </ItemTemplate>
        </telerik:GridTemplateColumn>
 .
 .column2, column3,...
 .

 </Columns>

        <EditFormSettings FormCaptionStyle-HorizontalAlign="Center">
       
            <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

 asp:sqlDataSource here
Update command, select command, insert command, delete command is here
update, insert, and delete parameters here.

Code behind

namespace Ames5.Schedule
{
    public partial class PWOPENITEMS : System.Web.UI.Page
    {
       
        public string GetConnectionString()
        {

            //sets the connection string from web config file "ConnString"

            return System.Configuration.ConfigurationManager.ConnectionStrings["AMES5DB_TESTConnectionString"].ConnectionString;
        }

        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                SqlConnection conn = new SqlConnection(GetConnectionString());
                SqlCommand cmd = new SqlCommand("Select DISTINCT OPCODE,FLEET,SUBFLEET from  PWOPENITEMS", conn);//query to get the distinct values.

                SqlDataAdapter sda = new SqlDataAdapter();
                sda.SelectCommand = cmd;
                DataSet ds = new DataSet();
                sda.Fill(ds, "tbl_data"); //nameing the table getting stored in DataSet as "tbl_data"

                string str1, str2, str3, str4;
                ArrayList MyDisplayList = new ArrayList();
                ArrayList MyValueList = new ArrayList();

                if (ds.Tables["tbl_data"].Rows.Count != 0)
                {
                    MyDisplayList.Add("ALL");
                    foreach (DataRow myRow in ds.Tables["tbl_data"].Rows)
                    {

                        str1 = myRow["OPCODE"].ToString();
                        str2 = myRow["FLEET"].ToString();
                        str3 = myRow["SUBFLEET"].ToString();
                        str4 = str1 + " " + str2 + " " + str3; //Concatinating three strings with space in between.

                        MyDisplayList.Add(str4);
                    }

                    RadComboBox1.DataSource = MyDisplayList;
                    RadComboBox1.DataBind();
                }
                else
                {
                    Response.Write("No Data");

                }

            }

           
            (RadAjaxManager.GetCurrent(this.Page) as RadAjaxManager).ResponseScripts.Add(string.Format("window['gridId'] = '{0}';", RadGridOpenItems.ClientID));

        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(GetConnectionString());
            if (RadComboBox1.SelectedItem.Text == "ALL")
            {
                string str = "SELECT * FROM PWOPENITEMS";
                SqlDataSourcePwOpenItems.SelectCommand=str;
               
                    RadGridOpenItems.DataBind();

            }
            else
            {
                string fullString = RadComboBox1.SelectedValue.ToString();

                string firstString = fullString.Substring(0, 3); //Extracting substring

                string middleString = fullString.Substring(3, 7); //Extracting substring

                string lastString = fullString.Substring(11, 1);

               
                string st = "SELECT * FROM PWOPENITEMS WHERE OPCODE = '" + firstString + "' AND FLEET = '" + middleString + "' AND SUBFLEET = '" + lastString + "'";
                SqlDataSourcePwOpenItems.SelectCommand = st;
             
                RadGridOpenItems.Rebind();

            }
        }

        protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
        {
            GridEditableItem item = (GridEditableItem)e.Item;
            String id = item.GetDataKeyValue("PWOPENITEMS_ID").ToString();

            if (e.Exception != null)
            {
                e.KeepInEditMode = true;
                e.ExceptionHandled = true;
                SetMessage("Product with ID " + id + " cannot be updated. Reason: " + e.Exception.Message);
            }
            else
            {
                SetMessage("Product with ID " + id + " is updated!");
            }
        }

        protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
        {
            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                SetMessage("Item cannot be inserted. Reason: " + e.Exception.Message);
            }
            else
            {
                SetMessage("New item is inserted!");
            }
        }

        protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.Item;
            String id = dataItem.GetDataKeyValue("PWOPENITEMS_ID").ToString();

            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                SetMessage("Product with ID " + id + " cannot be deleted. Reason: " + e.Exception.Message);
            }
            else
            {
                SetMessage("Product with ID " + id + " is deleted!");
            }
        }

        private void DisplayMessage(string text)
        {
            RadGridOpenItems.Controls.Add(new LiteralControl(string.Format("<span style='color:red'>{0}</span>", text)));
        }

        private void SetMessage(string message)
        {
            gridMessage = message;
        }

        private string gridMessage = null;
        protected void RadGrid1_DataBound(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(gridMessage))
            {
                DisplayMessage(gridMessage);
            }
        }

    }
}

 

Iana Tsolova
Telerik team
 answered on 27 Oct 2010
3 answers
126 views
Hello,
    I am looking for a combo box with a textbox as first item so that user can enter a text and then click on the dropdown to select a search kind ex. Starts with Ends With. This is a search condition attached to the RadGrid. Please refer to the following code. The search condition also has excel like advanced filter. Is it possible to make the first Item in the RadMenu - "All" to a editable mode?
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="true" AutoGenerateColumns="false"
                   GridLines="None" Width="95%" AllowPaging="true" PageSize="25" OnNeedDataSource="RadGrid1_NeedDataSource">
                   <MasterTableView Width="100%" DataKeyNames="City" AllowFilteringByColumn="true" FilterItemStyle-Width="100%">
                       <Columns>
                           <telerik:GridBoundColumn DataField="City" HeaderText="City" UniqueName="City">
                               <FilterTemplate>
                                   <telerik:RadComboBox ID="RadSearchComboBox" Height="60px" AppendDataBoundItems="true"
                                       AutoPostBack="true" Text="" runat="server" OnSelectedIndexChanged="FilterCombo_SelectedIndexChanged"
                                       OnClientSelectedIndexChanged="SelectedIndexChanged" ShowDropDownOnTextboxClick="true">
                                       <Items>
                                           <telerik:RadComboBoxItem Text="All" Value="All" Style="display: none;" />
                                           <telerik:RadComboBoxItem Text="Chennai" Value="Chennai"/>
                                           <telerik:RadComboBoxItem Text="Hyderabad" Value="Hyderabad" />
                                       </Items>
                                       <HeaderTemplate>
                                          <telerik:RadMenu runat="server" ID="radM" Flow="Vertical" >
                                          <Items>
                                           <telerik:RadMenuItem Text="Select Filter">
                                               <Items>
                                                   <telerik:RadMenuItem Text="Starts With" Value="SW"></telerik:RadMenuItem>
                                                   <telerik:RadMenuItem Text="Ends With" Value="EW"></telerik:RadMenuItem>
                                               </Items>
                                           </telerik:RadMenuItem>
                                          </Items>
                                          </telerik:RadMenu>
                                       </HeaderTemplate>
                                       <ItemTemplate>
                                           <asp:CheckBox runat="server" ID="CheckBox" onclick="stopPropagation(event);" Text="">
                                           </asp:CheckBox>
                                           <asp:Label ID="lbl" runat="server" Text='<%# DataBinder.Eval(Container, "Text") %>'></asp:Label>
                                       </ItemTemplate>
                                   </telerik:RadComboBox>
                               </FilterTemplate>
                           </telerik:GridBoundColumn>
                       </Columns>
                   </MasterTableView>
                   <PagerStyle Mode="NextPrevAndNumeric" />
               </telerik:RadGrid>
Thanks,
JJ
Jayavidya
Top achievements
Rank 1
 answered on 27 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?