Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
148 views
protected void RadGrid1_ExcelMLExportRowCreated(object source, GridExportExcelMLRowCreatedArgs e)  
{  
    if (yourCondition && e.RowType == GridExportExcelMLRowType.DataRow)  
        e.Worksheet.Table.Rows.Remove(e.Row);  
}  

but I can't find 'yourCondition' (is selected rows), please help me,
thank you Telerik Team
Daniel
Telerik team
 answered on 24 Dec 2009
5 answers
161 views

Hi support,

  I'm tring to configure the RadEditor by creating a virtual directory and pointing out to a Video Stream Server but it is not working.
  Every time when it loads the media manager I get a not found error.

  Any idea of what may be wrong?

Thanks in advance.

Regards.

Stanimir
Telerik team
 answered on 24 Dec 2009
3 answers
165 views
I tried to get a linkbutton's clientID which is inside an asp:datagrid not "radgrid" with below script and I set linkbutton's  onclientclick attribute at on itemdatabound, when I click linkbutton inside the datagrid confirmation well shown, but when clicking OK; result is nothing, what is the problem actually, I really want to understand how rad confirm work.

function setButtonClientID(clientID, text, title) 
                {
                    btnName = clientID;
                    radconfirm(text, ClientCallback, 480, 180, '', title); 
                }
                    
                var ClientCallback = function (arg)  
                {
                    //alert('btnName: ' + btnName + ' arg: ' + arg); 
                    if (arg) 
                    {
                        __doPostBack(document.getElementById(btnName).id, 'Recover');
                        //document.getElementById(btnName).click();
                       
                    }
                }
Svetlina Anati
Telerik team
 answered on 24 Dec 2009
1 answer
175 views
Hi,

I am using GridTemplateColumns and am trying to work around an issue.

In each row of the grid I am placing a link - when I mouse over these links I want to display a thumbnail (image) which hovers at the pointer.

Using the regular ASP.NET GridView control this is not a problem, but with the RadGrid I have an issue.

Currently I use css styling to display the thumbnails. When I use this method with RadGrid the thumbnail only displays partially as the thumbnail image appears in the space for the column it belongs to. For example, the image will not overlap the next column, but the image appears behind it instead. In the css for this thumbnail the zindex is set to a large number, but this has no affect with the RadGrid control.

Is there a way I can achieve this functionality with RadGrid?

Many thanks and happy holidays.

KS
Shinu
Top achievements
Rank 2
 answered on 24 Dec 2009
1 answer
98 views
Hi All,

Not display in date format, what's wrong with follwoing code:

<telerik:GridBoundColumn AllowFiltering="false" DataField="LoggedInFor"
                                            Display="true" HeaderStyle-Width="7%" HeaderText="Last Login"
                                            UniqueName="LoggedIn" DataFormatString="{0:D}">
                                            <HeaderStyle Width="7%" />
                                        </telerik:GridBoundColumn>


or

DataFormatString="{0:MMM/dd/yyyy}"


Thanks & Regards
Amit



Amitkumar
Top achievements
Rank 1
 answered on 24 Dec 2009
1 answer
259 views
Greetings,

I have been struggling a couple of days now with trying to create a grid programmatically with hierarchy using the entity framework and repository pattern.  For example, I am loading Product and Product Details.  I am retrieving my datasource using the entity framework.  See below for code to get Products and Product Details:

public

 

IQueryable<Product> GetProducts()

 

{

 

var products = from p in db.Product.Include("ProductDetail")

 

 

                            select p;

 

 

return products;

 

}

 

public IQueryable<ProductDetail> FindProductDetailsByProduct(Guid productID)

 

{

 

var productDetails = from pd in db.ProductDetail.Include("Product")

 

 

select pd;

 

 

return productDetails.Where(p=> p.Product.ProductID == productID);

 

}

In my codebehind I copied the DefineGridStructure function from the example given in the Grid / Creating Hierarchy Programmatically example:  http://demos.telerik.com/aspnet-ajax/grid/examples/programming/hierarchy/defaultcs.aspx  In this example, it uses a SQLDataSource whereas I'm wanting to bind the data programmatically.  I tried setting the datasource using my GetProducts() function and convert to list and assign to grid.  I have two columns ProductID and ProductName in my Masterview and two columns in my Detailview.  The grid loads and is populate however, when I try to expand, it does not find the relation key (ProductID) of the Masterview.  ProductID is the primary key in my Product table and it is the foreign key in my ProductDetail table.

I am new to using RadGrid and I am not seeing what I am doing wrong.  See actual code below and please point me in the right direction.  If there is an example that uses both programmatic creation  a gird hierarchy and advanced binding I would appreciate if you could forward me the link.  All the samples I have reviewed use on one aspect and I am having trouble putting it all together, including the inserts, updates and deletes.  My business rules are too complex to simply use an entity datasource control.

 

 

private void DefineGridStructure()

 

{

 

RadGrid RadGridProducts = new RadGrid();

 

RadGridProducts.ID =

"RadGridProducts";

 

RadGridProducts.DataSource = GetProductDataSource();

 

RadGridProducts.MasterTableView.DataKeyNames =

new string[] { "ProductID" };

 

RadGridProducts.MasterTableView.Name =

"ProductsView";

 

RadGridProducts.MasterTableView.CommandItemDisplay =

GridCommandItemDisplay.Top;

 

RadGridProducts.Width =

Unit.Percentage(98);

 

RadGridProducts.PageSize = 20;

RadGridProducts.AllowPaging =

true;

 

RadGridProducts.AllowSorting =

true;

 

RadGridProducts.PagerStyle.Mode =

GridPagerMode.NextPrevAndNumeric;

 

RadGridProducts.AutoGenerateColumns =

false;

 

RadGridProducts.ShowStatusBar =

true;

 

RadGridProducts.AllowAutomaticDeletes =

true;

 

RadGridProducts.AllowAutomaticInserts =

true;

 

RadGridProducts.AllowAutomaticUpdates =

true;

 

RadGridProducts.ClientSettings.ClientEvents.OnRowDblClick =

"RowDblClick";

 

 

 

//Register all events for grid

 

 

 

 

 

RadGridProducts.ItemDeleted +=

new GridDeletedEventHandler(RadGridProducts_ItemDeleted);

 

RadGridProducts.ItemInserted +=

new GridInsertedEventHandler(RadGridProducts_ItemInserted);

 

RadGridProducts.ItemUpdated +=

new GridUpdatedEventHandler(RadGridProducts_ItemUpdated);

 

RadGridProducts.InsertCommand +=

new GridCommandEventHandler(RadGridProducts_InsertCommand);

 

RadGridProducts.ItemCommand +=

new GridCommandEventHandler(RadGridProducts_ItemCommand);

 

RadGridProducts.PreRender +=

new EventHandler(RadGridProducts_PreRender);

 

RadGridProducts.NeedDataSource +=

new GridNeedDataSourceEventHandler(RadGridProducts_NeedDataSource);

 

RadGridProducts.DetailTableDataBind +=

new GridDetailTableDataBindEventHandler(RadGridProducts_DetailTableDataBind);

 

RadGridProducts.MasterTableView.PageSize =20;

RadGridProducts.MasterTableView.EditFormSettings.UserControlName =

"~/Controls/Products/ProductDetailsControl.ascx";

 

RadGridProducts.MasterTableView.EditFormSettings.EditFormType =

GridEditFormType.WebUserControl;

 

RadGridProducts.MasterTableView.EditFormSettings.EditColumn.UniqueName =

"EditCommandColumn1";

 

 

//Add columns

 

 

 

 

 

 

GridEditCommandColumn editColumn;

 

editColumn =

new GridEditCommandColumn();

 

editColumn.ButtonType =

GridButtonColumnType.LinkButton;

 

RadGridProducts.MasterTableView.Columns.Add(editColumn);

 

GridBoundColumn boundColumn;

 

boundColumn =

new GridBoundColumn();

 

boundColumn.DataField =

"ProductID";

 

boundColumn.HeaderText =

"Product ID";

 

boundColumn.UniqueName =

"ProductID";

 

boundColumn.Visible =

true;

 

RadGridProducts.MasterTableView.Columns.Add(boundColumn);

boundColumn =

new GridBoundColumn();

 

boundColumn.DataField =

"ProductName";

 

boundColumn.HeaderText =

"Product";

 

RadGridProducts.MasterTableView.Columns.Add(boundColumn);

boundColumn =

new GridBoundColumn();

 

boundColumn.DataField =

"ProductModel";

 

boundColumn.HeaderText =

"Model";

 

RadGridProducts.MasterTableView.Columns.Add(boundColumn);

boundColumn =

new GridBoundColumn();

 

boundColumn.DataField =

"Weight";

 

boundColumn.HeaderText =

"Weight";

 

RadGridProducts.MasterTableView.Columns.Add(boundColumn);

boundColumn =

new GridBoundColumn();

 

boundColumn.DataField =

"Dimensions";

 

boundColumn.HeaderText =

"Dimensions";

 

RadGridProducts.MasterTableView.Columns.Add(boundColumn);

boundColumn =

new GridBoundColumn();

 

boundColumn.DataField =

"SKU";

 

boundColumn.HeaderText =

"SKU";

 

RadGridProducts.MasterTableView.Columns.Add(boundColumn);

 

GridButtonColumn deleteColumn;

 

deleteColumn =

new GridButtonColumn();

 

deleteColumn.ButtonType =

GridButtonColumnType.LinkButton;

 

deleteColumn.CommandName =

"Delete";

 

deleteColumn.Text =

"Delete";

 

deleteColumn.ConfirmText =

"Are you sure you wish to Delete this item?";

 

RadGridProducts.MasterTableView.Columns.Add(deleteColumn);

 

//Detail table - (II in hierarchy level)

 

 

 

 

 

 

GridTableView tableViewProductDetails = new GridTableView(RadGridProducts);

 

tableViewProductDetails.DataSource = GetProductDetailsDataSource();

tableViewProductDetails.DataBind();

tableViewProductDetails.Name =

"ProductDetailsView";

 

tableViewProductDetails.Width =

Unit.Percentage(100);

 

tableViewProductDetails.DataKeyNames =

new string[] { "ProductDetailID" };

 

 

GridRelationFields relationFields = new GridRelationFields();

 

relationFields.MasterKeyField =

"ProductID";

 

relationFields.DetailKeyField =

"ProductID";    /*This line throwing error*/

 

tableViewProductDetails.ParentTableRelation.Add(relationFields);

RadGridProducts.MasterTableView.DetailTables.Add(tableViewProductDetails);

 

//Add columns

 

 

 

 

 

boundColumn =

new GridBoundColumn();

 

boundColumn.DataField =

"ProductDetailID";

 

boundColumn.HeaderText =

"ProductDetailID";

 

boundColumn.UniqueName =

"ProductDetailID";

 

tableViewProductDetails.Columns.Add(boundColumn);

boundColumn =

new GridBoundColumn();

 

boundColumn.DataField =

"MSRP";

 

boundColumn.HeaderText =

"MSRP";

 

tableViewProductDetails.Columns.Add(boundColumn);

 

 

//Add the RadGrid instance to the controls

 

 

 

 

 

 

this.PlaceHolder1.Controls.Add(RadGridProducts);

 

}

Regards,
Fred

Shinu
Top achievements
Rank 2
 answered on 24 Dec 2009
1 answer
179 views
Dear Sir/Madam,

i'm facing a bit problem related to RadGrid.

Explantion-: After filtering the value in RadGrid we can see the filter result after that i open a radwindow for a particular row id .
but when i closed the rad window the filter value of the RadGrid not holding.

Is it possible that we van hold that filter value when return the page.
please let me know it's very urgent..

Thanks & regards
Manoj Kumar Soni
Shinu
Top achievements
Rank 2
 answered on 24 Dec 2009
1 answer
149 views
Hi there,

Has anyone come across the situation where a RadEditor is on a page that is being forced to ssl, and the dialogs open up, but are always blank? It seems the control is creating an iframe to "/controls/RadControls/Editor/Dialog.aspx?dialog=ImageManager&editorID=dnn_ctr474_EditHTML_teContent_teContent&useSession=0&sessionID2=ABCSessionID&language=en_US&UseEmbeddedScripts=yes&tabid=86" which I would assume goes through secure, but it shows up blank, I get the message "Do you want to view only the webpage content that was delivered securely?" if I select no, just goes to the blank popup. If I choose yes, meaning don't send the unsecured content, I get a JavaScript error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 3.0.30618; InfoPath.2; SLCC1)
Timestamp: Wed, 23 Dec 2009 16:34:21 UTC

Message: Object expected
Line: 87
Char: 4

Code: 0
URI: https://www.TestSite.com/controls/RadControls/Editor/Dialog.aspx?dialog=ImageManager&editorID=dnn_ctr474_EditHTML_teContent_teContent&useSession=0&sessionID2=ABCSessionID&language=en_US&UseEmbeddedScripts=yes&tabid=86

 

Is this an issue you've seen?  Any help would be so greatly appreciated as we use the RadControls extensively and absolutely love them.

Regards,

Marco Andrade


Rumen
Telerik team
 answered on 24 Dec 2009
6 answers
134 views
Good day!

I'm trying to follow the online demos on a current project using the RadScheduler, but it seems that the Description field for the Appointment is missing. Was it removed on purpose on the latest version of the RadControls?

Thank you very much.
Joe Buckle
Top achievements
Rank 1
 answered on 24 Dec 2009
2 answers
160 views
Hi,
I am creating a radgrid, specifying the PageSize=20 and setting the PagerStyle Mode=NextPrevNumericAndAdvanced

 

 

Then, when I have less than 20 rows, no paging controls are displayed, that's fine.
But if I have 25 records it shows me the text box, where customer can specify desired page size. Ok.
If he specify here 30, nothing will change, page size will remain 20. Yes. if he sets page size to 25, all the records will be displayed and paging control disappears. I belive that should happed by default if he specify page size more than records in the grid.
Why it keeps the current page size instead of taking the max number of records as new value?
Am I missing some scenarios where it could be misleading?

Thank you,
Alex.

Princy
Top achievements
Rank 2
 answered on 24 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?