Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
43 views
Hello,

When i have a row in edit mode and try to expand, I cant retrieve the parentitem's column value.

In RadGrid1_DetailTableDataBind:

when i do  e.DetailTableView.ParentItem("BondID").Text) it returns " "

This works fine if the row is not in edit mode.
Sadiq
Top achievements
Rank 1
 answered on 07 Feb 2011
2 answers
107 views
Hello,
I'm creating dynamic radgrid with dynamic columns names. The names all come from the database and can be either in English or in French. When a column's name contain a french character such as é à è ê ç... or if it contain ' or - a space is automatically added after the character witch odd result such as:
"Remplaç
ant"
or
"Anné
e"
or
"sous
-
code"
I tried to prevent text wraping this way:
grid.HeaderStyle.Wrap = false;
This way I don't get odd wrapping, but I still get space after those character, so it now looks like:
"Remplaç ant"
"Anné e"
"sous- code"
It's a little bit better but far from acceptable. The data binding is done this way (table been a DataTable):
grid.DataSource = table;
I tried to use Server.HtmlEncode() to make sure that the string is in the right format, but no luck... Since I'm using a DataTable, I don't think I can use TextBlock.  Any idea?

Thanks,
LP
Marco
Top achievements
Rank 1
 answered on 07 Feb 2011
1 answer
72 views
when i try to replace GridTemplateColumns with my customFilteredGridTemplateColumns the RadGrid isnt shown due to many bugs which seems irrelevant to Rad objects at all. what am i doing wrong? here is my implementation:

 

 

public class CustomFilteredGridTemplateColumn : GridTemplateColumn

 

{

 

 

public override GridColumn Clone()

 

{

 

 

return base.Clone();

 

}

 

 

protected override void SetupFilterControls(System.Web.UI.WebControls.TableCell cell)

 

{

 

 

base.SetupFilterControls(cell);

 

cell.Controls.RemoveAt(0);

cell.Controls.AddAt(0,

 

new TextBox());

 

}

 

 

public override bool SupportsFiltering()

 

{

 

 

return true;

 

}

 

 

protected override string GetFilterDataField()

 

{

 

 

return this.DataField;

 

}

 

 

protected override void SetCurrentFilterValueToControl(TableCell cell)

 

{

 

 

base.SetCurrentFilterValueToControl(cell);

 

(cell.Controls[0]

 

as TextBox).Text = this.CurrentFilterValue;

 

}

 

 

protected override string GetCurrentFilterValueFromControl(TableCell cell)

 

{

 

 

return (cell.Controls[0] as TextBox).Text;

 

}

}

Pavlina
Telerik team
 answered on 07 Feb 2011
3 answers
101 views
I have a RadGrid with a date column and several text columns and filtering enabled. When I select a date to be filtered, type text in one of the text fields and then select another filter field, the grid filters properly, but I can no longer type in the filter text fields.

I am using RadControls for ASP.NET Ajax Q2 2009.

Any suggestions?

My grid code is:
<telerik:RadGrid ID="ShipmentHistoryGrid" runat="server" Skin="Web20" OnNeedDataSource="OnShipmentHistoryGridNeedDataSource" 
    ShowStatusBar="True" AutoGenerateColumns="False" GridLines="None" OnItemDataBound="OnItemDataBound" 
    AllowFilteringByColumn="true" AllowSorting="true"
    <PagerStyle Mode="NextPrevAndNumeric" /> 
    <MasterTableView DataKeyNames="PackageID" CommandItemDisplay="None" TableLayout="Fixed"
        <Columns> 
            <telerik:GridDateTimeColumn FilterControlWidth="90px" DataField="ShippingDate" UniqueName="Date" 
                HeaderText="Ship Date" DataFormatString="{0:d}" AutoPostBackOnFilter="true" ShowFilterIcon="false"
                <HeaderStyle Width="95px" /> 
            </telerik:GridDateTimeColumn> 
            <telerik:GridBoundColumn DataField="Pin" UniqueName="Pin" HeaderText="Pin" AutoPostBackOnFilter="true" 
                CurrentFilterFunction="Contains" ShowFilterIcon="false" > 
                <HeaderStyle Width="100px" /> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="ShortService" UniqueName="ServiceType" HeaderText="Service" 
                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                <HeaderStyle Width="120px" /> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="Contact" UniqueName="Contact" HeaderText="Name" 
                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                <HeaderStyle Width="100px" /> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="City" UniqueName="City" HeaderText="City" AutoPostBackOnFilter="true" 
                CurrentFilterFunction="Contains" ShowFilterIcon="false"
                <HeaderStyle Width="100px" /> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn FilterControlWidth="30px" DataField="Province" UniqueName="Province" HeaderText="Province" 
                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                <HeaderStyle Width="60px" /> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="PostalCode" UniqueName="PostalCode" HeaderText="Postal Code" 
                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                <HeaderStyle Width="95px" /> 
            </telerik:GridBoundColumn> 
            <telerik:GridCheckBoxColumn DataField="IsVoid" UniqueName="IsVoid" Visible="false"
            </telerik:GridCheckBoxColumn> 
            <telerik:GridTemplateColumn UniqueName="VoidColumn" AllowFiltering="false" HeaderText="Void"
                <ItemTemplate> 
                    <asp:Button ID="btnVoid" runat="server" OnClick="OnClickVoid" Text="Void" /> 
                    <asp:Label ID="VoidLabel" runat="server" Text="Package Voided"></asp:Label> 
                </ItemTemplate> 
                <ItemStyle HorizontalAlign="Center"/> 
                <HeaderStyle HorizontalAlign="Center" /> 
            </telerik:GridTemplateColumn> 
        </Columns> 
    </MasterTableView> 
    <ClientSettings> 
        <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
    </ClientSettings> 
</telerik:RadGrid> 
 
Martin
Telerik team
 answered on 07 Feb 2011
3 answers
84 views
hello,

im on an older version of RadControls for ASP.NET AJAX ("2009.2 826") but i think the answer to my question should be pretty straight-forward.

im using a RadGrid that uses WebUserControl for the grid's EditFormType. This .ascx form is displayed for Insertion and Update operations. my question -- in the user control's code-behind, how can i tell which mode the code is being executed as? i use this to show different things if the user is performing an Insert vs. an Update.

currently i use this code in the user control's .ascx.cs:

private void Page_PreRender(object sender, EventArgs e)
{
    //this is the only way i know how to check what mode this grid control is operating in.
    bool isGridInsertion = Object.ReferenceEquals(this.DataItem.GetType(), new GridInsertionObject(new ArrayList()).GetType() );
 
    if (isGridInsertion != true) //we check this because the below int assignment breaks on a grid insertion (since ProductTypeID has no value during our Insert form, only populated on Edit)
    {              
        int productTypeID = (int)DataBinder.Eval(this.DataItem, "ProductTypeID");
 
        // do stuff
    }
}

...is there a better way than doing the Object.ReferenceEquals on the DataItem's type (comparing it to a GridInsertionObject's type) ?


thanks!
matt
Martin
Telerik team
 answered on 07 Feb 2011
1 answer
46 views
Hi,

  I added Radgrid in my user control page...I used UserControl in other aspx pages.... While doing that i dint get Radgrid Header....I want to show Radgrid Header.... what i should do for that......

Thanks & Regards,
Asik
Pavlina
Telerik team
 answered on 07 Feb 2011
2 answers
74 views
Hi,

I got an application with a ListView containing RadControls in InsertItemTemplate.
I would like to propose to the visitor a value in a RadTextBox calculated on value inserted by this visitor in another RadTextBox.
But how can I get access to these fields in js ?
In .Net code behind no problem.. but I don't know how to do that on client side.

Can someone help me on this ?

Regards,

David
Maria Ilieva
Telerik team
 answered on 07 Feb 2011
1 answer
72 views

Hello,

I have requirement to refresh the RADGrid after user download the selection. So i have first column as checkboxes and users selects those checkbox and as per the selection code gets the document and gives it for download to user.


                        Response.ContentType = "text/plain";
                        Response.AddHeader("Content-Disposition", "attachment;filename=" + FileName);
                        Response.ClearContent();
                        Response.Buffer = true;
                        Response.Write(objBuilder.ToString());
                        Response.End();


So now i have to remove the selection after download and make those records of RADGrid with different color to indicate that record is already downloaded. how i can do that ?
Daniel
Telerik team
 answered on 07 Feb 2011
2 answers
86 views
I have a grid with image button column. On Client click I want to open window with some data from another class. The following code does that but need to click button twice. I just can not fugure out wants wrong. Please help.
.cs
if (e.CommandName == "viewQuals")
            {
                GridDataItem dataItem = (GridDataItem)e.Item;
                int id = int.Parse(dataItem["EIDColumn"].Text);
                ImageButton updateButton = dataItem["viewQualsColumn"].Controls[0] as ImageButton;
                updateButton.OnClientClick = "return viewQualsClick(" + id + ")";
               }
.aspx
function viewQualsClick(id) {
                  
                window.open("RES_MQ_new.aspx?empid=" + id, "", "width=550,height=700,resizable=yes,scrollbars=yes");
            }
 function ajaxRefresh() {
           var ram = $find("<%= RadAjaxManager.ClientID %>");
            ram.ajaxRequest("foo");
                  
            }
When I click for the first time, it goes to "<%= RadAjaxManager.ClientID %> and does nothing. And second click the window pops up with correct data.

 

 

 

Smiely
Top achievements
Rank 1
 answered on 07 Feb 2011
6 answers
334 views
Hi Telerik Team,
  This problem is related with opening a RadWindow. I have a RadGrid with a button column and need to open an Radwindow within its click event (command event). So far, this has not been a problem for me, since I had call the RadWindow mostly in
button click event of a button. (I did it like -- > RadWindow1.VisibleOnPageLoad=true ). 
But when I try to do the same thing the window is not shown (pop-up). Can you please tell me the reason? 

Note: The reason for me to open/show  the RadWindow in code behind using "RadWindow1.VisibleOnPageLoad=true" is, I need to 
to do some validations to get the decision whether to open it or do another operation. 


Thanks,
Dilip Nilanka
Smiely
Top achievements
Rank 1
 answered on 07 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?