Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
114 views
Hi,

I was looking for a way to disable the 'case sensitive' in column filters. Please help.

thanks,
Minh Bui
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Sep 2011
1 answer
179 views
INSERTCOMMAND in a RadGrid inside a Raddock is not firing!

I have a RadGrid inside a RadDock. I am doing some updating/inserting built in the RadGrid.

The RadGrid's ItemCommand fires ok when clicking to INIT insert.

However the ItemCommand, UpdateCommand / InsertCommand ARE NOT FIRING when clicking to perform Insert.
They fire OK if I just put the grid on the page (without the raddock), it works fine, but they won't fire if the grid is inside the raddock.

I need to know why this is happening.

Thanks,
Simone

 

 Source:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="WebForm4.aspx.cs" Inherits="SMTPro.WebForm4" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadDockLayout runat="server" EnableViewState="false" ID="RadDockLayout1"
        StoreLayoutInViewState="false">
        <telerik:RadDock ID="rdRepAds" runat="server" Title="Ads" Width="600px" EnableAnimation="true"
            Skin="Office2010Silver" EnableRoundedCorners="true" Resizable="true" AutoPostBack="true">
            <ContentTemplate>
                <telerik:RadGrid ID="grdRepAds" runat="server" CellSpacing="0" GridLines="None" PageSize="20"
                    EnableViewState="true" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True"
                    OnItemCommand="grdRepAds_ItemCommand" OnItemDataBound="grdRepAds_ItemDataBound"
                    OnInsertCommand="grdRepAds_InsertCommand">
                    <ClientSettings>
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>
                    <MasterTableView DataKeyNames="ID" CommandItemDisplay="Bottom" AutoGenerateColumns="False"
                        FilterExpression="Active = true">
                        <CommandItemTemplate>
                            <asp:LinkButton ID="btnInitInsert" runat="server" CommandName="InitInsert"><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" />Add new&nbsp;&nbsp;&nbsp;&nbsp;</asp:LinkButton>
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridBoundColumn DataField="RepID" FilterControlWidth="130" HeaderText="RepID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="AdID" FilterControlWidth="130" HeaderText="AdID">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                    </HeaderContextMenu>
                </telerik:RadGrid>
            </ContentTemplate>
        </telerik:RadDock>
    </telerik:RadDockLayout>
</asp:Content>


 

 =============

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                using (var db = new mockupEntities())
                {
                    int repID;
                    repID = 7784;
                    var query = from sr in db.RepAds
                                where sr.RepID == repID
                                select sr;

                    grdRepAds.DataSource = query.ToList();
                    Session["dsRepAdsByRepID"] = query.ToList();
                }
            }
            else
            {
                grdRepAds.DataSource = Session["dsRepAdsByRepID"];
            }
        }

        protected void grdRepAds_ItemCommand(object sender, GridCommandEventArgs e)
        {
        }

        protected void grdRepAds_ItemDataBound(object sender, GridItemEventArgs e)
        {
        }

        protected void grdRepAds_InsertCommand(object sender, GridCommandEventArgs e)
        {
            //does not fire!!!!!!!!!
        }

 

Simone
Top achievements
Rank 1
 answered on 26 Sep 2011
1 answer
231 views
Hi,
I am trying to export RadGrid to PDF or Excel with CSS, I looked at the sampe at:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/pdfexport/defaultcs.aspx
and have the following questions:
(1) What ever css I apply to the grid for rendering will not apply for exporting, right?
(2) Can I use css class for exporting styles? The sample seems to use inline styling only
(3) Will the same styles for exporting pdf work with exporting for Excel?

Thanks

 
Daniel
Telerik team
 answered on 26 Sep 2011
12 answers
422 views
Hi,
   I have a few controls along witha  RadDatePicker in a grid.
When i click on the calender button, the calender opens exactly below the icon.
However, the calender opens miles below the icon when clicked after there is a postback on the grid.
 Any suggestions on how to keep this fixed would help. I am pasting my code below

<

 

telerik:RadDatePicker ID="Datepicker" runat="server" Skin="Vista" Width="100px" >

 

 

 

<DateInput ID="Date" runat="server"></DateInput>

 

 

 

<Calendar ID="CalDate" runat="server"  UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>

 

 

 

<DatePopupButton CssClass="rcCalPopup"></DatePopupButton>

 

 

 

</telerik:RadDatePicker>

 

 

 

 

This is most common in the controls in the edit mode of the grid.

Tsvetina
Telerik team
 answered on 26 Sep 2011
1 answer
91 views

I am trying to create a simple grd that will take a programmatically generated datatable and allow sorting in a usercontrol that is used in DotNetNuke.
My code:
Private dt As DataTable

Private WithEvents RadGrid1 As RadGrid

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
dt = New DataTable()
dt.Columns.Add("PMID")
dt.Columns.Add("BioText")
dt.Columns.Add("Version")
dt.Columns.Add("PMCID")
dt.Columns.Add("ManuscriptID")
dt.Columns.Add("DOI")
dt.Columns.Add("pii")
dt.Columns.Add("Authors")
dt.Columns.Add("ISOAbbreviation")
dt.Columns.Add("Year")


RadGrid1 = New RadGrid
RadGrid1.AutoGenerateColumns = True
RadGrid1.DataSource = dt
RadGrid1.AllowSorting = True
RadGrid1.Skin = "Outlook"
PlaceHolder1.Controls.Add(RadGrid1)

End Sub
Then I create the datatable from data that I get from a webservice. 
however when I click the column to sort all of the data disappears as if the Grid does not have any data source. I then added:

Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
RadGrid1.DataSource = GetDataTable("")
End Sub
Public Function GetDataTable(ByVal query As String) As DataTable
Return dt
End Function

but that does not seem to help. I've searched the forums for hours but it seems that I cannot find a total solution. I'm not sure if I need to wrap my placeholder in a panel or not. All help is appreciated.
Thanks

Daniel
Telerik team
 answered on 26 Sep 2011
4 answers
109 views
Hi all,

I am using a RadTreeList with drag and drop enabled. This works fine.
Now I want to prevent items at the highest level from being dropped on another item. These items cannot be the child of another item.

How can I accomplish this?

I think I can prevent the dropping of certain items in the itemDragging, but I don't know how to access the dragged_item here.
Then I can do something like:
if (level of the dragged item  is zero) then args.set_canDrop(false);

Annet
annet
Top achievements
Rank 1
 answered on 26 Sep 2011
2 answers
118 views
Hi,
I've spent all day trying to get RadGrid to export to pdf with formatting, there are so many problems I can not resolve, my codes are based on : http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/pdfexport/defaultcs.aspx
Here is my ItemCreated event handler:
void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (isPdfExport)
    {
        GridItem item = e.Item as GridItem;
        switch (item.ItemType) //Mimic RadGrid appearance for the exported PDF file
        {
            case GridItemType.Item:
                item.Style["background-color"] = "#ffffff";
                item.Style["font-size"] = "12px";
                item.Cells[2].Style["width"] = "50px";
                break;
            case GridItemType.AlternatingItem:
                item.Style["background-color"] = "#eeeeee";
                item.Cells[2].Style["width"] = "50px";
                item.Style["font-size"] = "12px";
                break;
            case GridItemType.Header:
                for (int i = 0; i < item.Cells.Count; i++)
                {
                    item.Cells[2].Style["width"] = "50px";
                    item.Cells[i].Style["text-align"] = "left";
                    item.Cells[i].Style["background-color"] = "#010101";
                    item.Cells[i].Style["color"] = "#ffffff";
                }
                break;
            case GridItemType.Footer:
            case GridItemType.GroupHeader:
            case GridItemType.GroupFooter:
                break;
        }
    }
}
The major problems I have:
(1) Width does not work at all, every column has equal width on exported pdf no matter how I set them.
(2) Contents do not wrap, if the data source has columns to long to be fitted in a row, they got truncated or overlap with next column.
(3) Sometimes it simply throws exceptions if the data source has lengthy data, I suspect the data might contain html tags.
(4) How do I control the boders? I tried Style["border"] = "1px solid #000", no effects at all. 

Please help     

Daniel
Telerik team
 answered on 26 Sep 2011
2 answers
264 views
Hi,
  I have a treeview that cause automatically expand   the parent nodes when you click it on the Client in order to see their childs.
I would like to expand only one parent node at a time.If i expand another one the previous node should automatically collapsed?
How can I?

Nirmal
Srujana
Top achievements
Rank 1
 answered on 26 Sep 2011
2 answers
123 views
Is it possible to select the month using RadMonthYearPicker without clicking "[OK]" in the PopupControl (like using DateTimePicker)?
Lukasz Kalbarczyk
Top achievements
Rank 1
 answered on 26 Sep 2011
3 answers
89 views
hi all,

i have a rad combo in ASP grid view
on button click we add a new row at bottom of Grid view this is done with JS code pasted below

 

var newRow=grd.rows[grd.rows.length-1].cloneNode(true);

 

tbod.appendChild(newRow);

now the Problem i inserted 3 rows to my Grid view
when i click the arrow of rad combo of the 3rd row its opening rad combo in the first row

but when i repllace rad combo with drop down its working fine

how to resolve this?

Thanks, Harin

Dimitar Terziev
Telerik team
 answered on 26 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?