Hello,
so im trying to add a button to the first cell in the Filtermenu with a 'Clear all filters' functionality. However i cant seem to get a handle on the first cell.
Here's some testing that i've tried so far with various examples i've found over the internet.
Private Sub Grid_OnItemCreated(sender As Object, e As GridItemEventArgs) If e.Item.ItemType = GridItemType.FilteringItem Then Dim clearFilterButton = New RadButton() With {.ButtonType = RadButtonType.StandardButton, .Height = 22, .Width = 22, .Text = "Clear Filter", .ToolTip = "Clear all filters"} AddHandler clearFilterButton.Click, AddressOf ClearFilterButton_Click Dim grid As RadGrid = CType(sender, RadGrid) Dim firstcell = grid.Controls(0) firstcell.Controls.Add(clearFilterButton) End If End Sub Private Sub ClearFilterButton_Click(sender As Object, e As EventArgs) For Each grid As RadGrid In Controls.All().OfType(Of RadGrid)() grid.MasterTableView.FilterExpression = String.Empty grid.Rebind() Next End Sub
I cant seem to get it to do anything at all tho. Even just trying to hide the Filtermenu does not seem to do anything. And yes the event is firing, it is triggered in the basepage load. Is this the way to add a button to a filtermenu? Or is there a better way?
Regards
Hi,
While user tabbing through the toolbar.and then press enter or spacebar on any of the toolbar icon's to select(like bold,italic or underline),focus is moving to RadEditor.Instead focus should remain on the toolbar's icon which ever user selected.
Thanks
Geeta
I am trying to to use the AsyncUpload so that when a user chooses a file to upload via ajax it is sent to the server and put into a collection object with existing attachments associated with my form. Using a sample from the demos and documentation I have it doing, this, but I have an issue that when it uploads I want to clear the pending upload screen. Essentially I want to clear the UploadedFiles items when it does the ajax routine. However no matter what I do it won't work. I get an enumeration error when I use the clear method. Any help on this would be appreciated. Again all I want is when the upload file is selected an ajax call posts it back, it's added to a collection and then upload control is cleared so they can add more.
ASP.NET
<telerik:RadAsyncUpload ID="rulAttachments" runat="server" RenderMode="Lightweight" AutoAddFileInputs="false" Localization-Select="" MaxFileSize="5000000" OnClientFilesUploaded="OnClientFilesUploaded" OnFileUploaded="rulAttachments_FileUploaded" ></telerik:RadAsyncUpload>
Javascript
function OnClientClickingUpload(sender) { //sender.set_autoPostBack(false); $telerik.$(".ruFileInput").click();}(function (global, undefined) { var demo = {}; function OnClientFilesUploaded(sender, args) { $find(demo.ajaxManagerID).ajaxRequest(); } function serverID(name, id) { demo[name] = id; } global.serverID = serverID; global.OnClientFilesUploaded = OnClientFilesUploaded;})(window);//<![CDATA[serverID("ajaxManagerID", "<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); //]]>
C#
protected void rulAttachments_FileUploaded(object sender, FileUploadedEventArgs e) { if (rulAttachments.UploadedFiles.Count > 0) { byte[] content; using (Stream str = e.File.InputStream) { content = new byte[str.Length]; str.Read(content, 0, content.Length); } SelectedInventoryRequest.Attachments.Add(new BLL.FileAttachment { Id = "", Description = e.File.FileName, FileData = content, NewFile = true, FilePath = ConfigurationManager.AppSettings["DocumentumInProcessPath" + ConfigurationManager.AppSettings["CurrentRegion"]] + "/" + SelectedInventoryRequest.InventoryRequestID.ToString() }); rulAttachments.UploadedFiles.RemoveAt(0); BindAttachments(); } }
| <telerik:RadScheduler runat="server" DataEndField="EndDate" DataKeyField="TaskID" DataStartField="StartDate" DataSubjectField="Title" Skin="Web20" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" SelectedView="WeekView" OverflowBehavior="Expand" DataSourceID="SqlDataSource1" ID="scheduler"> |
How to set <telerik:EditorTool Name="InsertImage" Text="Insert Image Dialog"></telerik:EditorTool> to show all properties by default ?
Hello,
I have an issue accessing the control of a, code behind generated, GridTemplateColumn from a click event of a button outside of the RadGrid.
<telerik:RadGrid ID="MyGrid" runat="server" AutoGenerateColumns="true" AllowSorting="true" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" OnColumnCreated="Siblings_ColumnCreated"> <GroupingSettings CaseSensitive="false" /> <HeaderStyle HorizontalAlign="Center" BorderWidth="1" /> <ClientSettings AllowColumnsReorder="false"> <Selecting AllowRowSelect="false" /> </ClientSettings> <MasterTableView AllowPaging="false" DataKeyNames="MyField" CommandItemDisplay="None" TableLayout="Fixed"> </MasterTableView></telerik:RadGrid>
protected void Page_Load(object sender, EventArgs e){ if (!IsPostBack) { if (MyCondition) { MyGrid.MasterTableView.EditMode = GridEditMode.Batch; var MyTemplateColumn = new GridTemplateColumn(); MyTemplateColumn.UniqueName = "MyTemplateColumn"; MyTemplateColumn.HeaderText = "MyTemplateColumn"; MyTemplateColumn.ItemTemplate = new MyTemplate(); MyGrid.Columns.Add(MyTemplateColumn); } MyGrid.DataSource = MyDataTable; MyGrid.DataBind(); }}public partial class MyTemplate : ITemplate{ public void InstantiateIn(Control container) { var cb = new RadComboBox(); cb.ID = "MyComboBox"; cb.AutoPostBack = false; container.Controls.Add(cb); }}protected void MyButton_Click(object sender, EventArgs e){ foreach (GridDataItem item in MyGrids.Items) { //This works, I have access to all the autogenerated columns and their values string MyValue = item["MyField"].Text; //This works, I have access to the Template column TableCell MyTemplateColumn = item["MyTemplateColumn"]; //doesn't work => Controls.Count = 0 var MyColumnCombobox = MyTemplateColumn.Controls[0] as RadComboBox; //doesn't work var MyRowCombobox = item.FindControl("MyTemplateColumn") as RadComboBox; }}
Anyone can help ?
Thank you.
