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

Has anyone done anything about printing appointments in an Outlook style way?  I don't know if anything is built into the scheduler, or if this is something that just needs customizable....  Does the scheduler support printing in a readable format?

Thanks.
Peter
Telerik team
 answered on 25 Feb 2009
6 answers
126 views
I am new to the Telerik tools.  I have developed a few basic web pages using the Grid, Tab and Multiple tools.  They work fine on development system.  However, when deployed to production the formatting is gone and the multi page stops working.  I am running version Ajax 2008 3 1314.  It very well may be a configuration with the production server.  We are running MS 2003 with IIS 6.0.  We have ajax working on other production sites and should be current with service packs. 

Any help will be appreciated.
Patrick
Paul
Telerik team
 answered on 25 Feb 2009
1 answer
118 views
Hi,

we are using automatic actions in RadGrid for inserting, updating and deleting.
In examples an e.exception is checked after trying to get the id of the changed/deleted item.
If this exception is there an error message is shown and the operation was canceled.

Now this is our intended behaviour too - but with another check. Additionally i have to check against a database if it is allowed to delete this record. So i put some lines of code to ItemDeleted event.
My problem is that i have no event/method/exception for canceling the deleting of my database check results in false.
If i throw an exception and catch them at the end the event was fine and deletion was processed.

Is there any other possibililty to do this without setting automaticactions to false and write my own code?
Simply by setting a property to cancel delete or update?

Thanks in advance for clarify my issue.
Regards
Stefan
Yavor
Telerik team
 answered on 25 Feb 2009
1 answer
46 views
I have added CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" to the following radGrid to allow user to default to Contains, and when press return, initiate the search:

<

 

rad:GridTemplateColumn SortExpression="StringValue" HeaderText="Value" DataField="StringValue" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" >

It works perfectsly in FF3, but on IE7, it causes javascript error, Invalid Arguement.

Is this a bug,or how can I fix it?

       Thanks, Ming

 

Daniel
Telerik team
 answered on 25 Feb 2009
1 answer
95 views
How can I insert a new row at the top of the grid? currently new rows are added at the bottom (if there is a paging - they are added at the last page, bottom). I'm using automatic insert / update.
Pavlina
Telerik team
 answered on 25 Feb 2009
1 answer
98 views
Hi telerik team,

I have a telerik RadGrid with Outlook style. in which i have few issues.

1)Is there possibity to place a link or button on top of header row like (customized controls)Add ,edit,refresh,e.t.c
which can be approach using commanditemtemplate.
Here due to <GroupByExpressions> i m unable to insert customized controls which i approached using commanditemtemplate .
in common grid and hierarchical grid.
(Refer the second image to understand ,In image right side to status dropdown i want to keep one more button  )

2)can u look the below links.i want outlook grid look in that format.
http://picasaweb.google.com/lh/photo/pe1VgtBPq-lg5ncf-6XUcA?feat=directlink.
the main problem for me is grouping. when i expand status it should show header and
rows,  again if i expand particular row means relative to that detailed table should get display(including with header).

but i was getting output in the below image format.
http://picasaweb.google.com/lh/photo/19oMcWEnoBWLVdBuzBLndg?feat=directlink.

3)if i select particular row in outlook grid. it is selecting checkbox in particular row and header column
checkbox meanwhile . how to arrest header column checkbox not get checked if i select particular row.

Thanks for any help.
Pavlina
Telerik team
 answered on 25 Feb 2009
3 answers
199 views

Requirements

RadControls version

.NET version

3.5
Visual Studio version

2008
programming language

C#
browser support

all browsers supported by RadControls


PROJECT DESCRIPTION
This code can be used on a RadGrid to allow Check/Uncheck of items. If a single row checkbox is checked, it posts back saving the checked value to the database. If the CheckAll is selected, it loops through saving the checked value of each row to the applicable row in the database.

Assumptions:
- Using a custom Entity model
    - all methods to get and save data on entity model (NOT INCLUDED IN CODE BELOW)

- You have a field in the database called "IsActive"

---- GRID HTML -----
OnPreRender="RadGrid1_PreRender"

<Columns>
        <telerik:GridTemplateColumn UniqueName="CheckBoxColumn" HeaderText="Blocked">
                <HeaderTemplate>
                        <asp:CheckBox ID="CheckAll" AutoPostBack="true" OnCheckedChanged="CheckAll_CheckChanged" runat="server" />
                </HeaderTemplate>
                <ItemTemplate>
                        <asp:CheckBox id="CheckBox1" OnCheckedChanged="CheckBox1_CheckChanged" AutoPostBack="True"  runat="server"></asp:CheckBox>
                </ItemTemplate>
        </telerik:GridTemplateColumn>
</Columns>


------ CODE BEHIND --------
#region Members
    DataTable _gridData = null;
#endregion

#region Properties
    /// <summary>
    /// locally cache grid data table - did this so I could set the checkbox values
    /// </summary>
    private DataTable GridData
    {
        get
        {
            if (_gridData == null)
            {
                _gridData = MyEntity.GetGridData();
            }

            return _gridData;
        }
    }

#endregion

#region Custom Methods

    private void CheckAll(string checkBoxValue)
    {
        foreach (GridItem item in RadGrid1.Items)
        {            
            SaveCheckValueChanges(item, checkBoxValue);
        }
    }

    /// <summary>
    /// Updates entity with current Checked value
    /// </summary>
    /// <param name="item"></param>
    private void SaveCheckValueChanges(GridItem item)
    {
        SaveCheckValueChanges(item, null);
    }

    /// <summary>
    /// Updates entity with current Checked value
    /// </summary>
    /// <param name="item"></param>
    private void SaveCheckValueChanges(GridItem item, string defaultBlockedValue)
    {
        if (item is GridEditableItem)
        {
            CheckBox IsActive = item.FindControl("IsActive") as CheckBox;
            string ID = item.OwnerTableView.DataKeyValues[item.ItemIndex][MyEntity.DBFieldName.ID.ToString()].ToString();
            MyEntity entity = MyEntity.GetByPrimaryKey(ID);
            
            if (!String.IsNullOrEmpty(defaultBlockedValue))
            {
                entity.IsActive = defaultBlockedValue;
            }
            else
            {
                entity.IsActive = IsActive.Checked.ToString();
            }

            entity.SaveData();
        }
    }

    /// <summary>
    /// Update grid checkboxes. Set checked=true for each selected item
    /// </summary>
    /// <param name="dt">DataTable representing bound grid items</param>
    public void SetSelectedGridItems(DataTable dt)
    {
        foreach (DataRow dr in dt.Rows)
        {
            foreach (GridItem item in RadGrid1.Items)
            {
                GridDataItem dataitem = (GridDataItem)item;
                if (dataitem[MyEntity.DBFieldName.ID.ToString()].Text.Equals(dr[MyEntity.DBFieldName.ID.ToString()].ToString()))
                {
                    //check row
                    CheckBox checkBox = item.FindControl(MyEntity.DBFieldName.IsActive.ToString()) as CheckBox;
                    checkBox.Checked = ConvertValueToBoolean(dr[MyEntity.DBFieldName.IsActive.ToString()].ToString());
                    break;
                }
            }
        }
        
    }
   
#endregion


#region Page Events
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
                RadGrid1.DataSource = this.GridData;
                RadGrid1.MasterTableView.DataKeyNames = new string[] { MyEntity.DBFieldName.ID.ToString() };
    }

    protected void CheckAll_CheckChanged(object sender, EventArgs e)
    {
            CheckBox checkBox = sender as CheckBox;
            if (checkBox != null)
            {
                    CheckAll(checkBox.Checked.ToString());
            }
    }
    
    protected void CheckBox1_CheckChanged(object sender, EventArgs e)
    {
            GridItem item = (sender as CheckBox).Parent.Parent as GridItem;
            SaveCheckValueChanges(item);
    }


    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
            //use locally cached data table to set IsActive checkboxes on grid
            SetSelectedGridItems(this.GridData);
    }
    
#endregion

Yavor
Telerik team
 answered on 25 Feb 2009
1 answer
343 views
Hi

    here i am working with radgrid, with each row multiple images. this uploading process.
i have created multiple images for each row. but i want delete option on row. that should  be create  dynamically.

i have code written like this

protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
        {
            if (!e.Item.OwnerTableView.IsItemInserted)
            {
                LinkButton lbtn = new LinkButton();
                lbtn.ID = "File" + i;
                lbtn.Text = "Delete";
                lbtn.OnClientClick = "return confirm('Are you sure delete this file')";
                lbtn.Click += new System.EventHandler(OnDelete);
                ViewState["UploadID"] = Convert.ToString(dt.Rows[i]["UploadedID"]);
                (e.Item.FindControl("EditplaceHolder") as PlaceHolder).Controls.Add(lbtn);                                      

            }

        }
    }
protected void OnDelete(Object sender, EventArgs e)
        {
            int UpLoadedFileID = Convert.ToInt32(ViewState["UploadID"]);
            objBO.DeleteFileID(UpLoadedFileID);
        }

but onDelete not working when i click on delete which is created dynamically.

please reply ASAP.

thx
ravi


Princy
Top achievements
Rank 2
 answered on 25 Feb 2009
3 answers
143 views
Quick correction --> Timer tick is at 15 seconds and not 15 msecs as mentioned earlier.

Look forward to your suggestion.

Thanks


I'm using the Q3 2008 version of the RadGrid and am facing a limitation that needs a workaround. Basically the Web page containing the grid uses a timer to poll for data from the SQL Cache, in the NeedDataSource event.

The problem is that the Timer tick is set at 15 msecs and so when the user types in some text to filter on, on every tick (which in turn will fire the NeedDataSource) , the filter box gets cleared. I've already implemented a Persistence solution using Profile to store the filter expression/pattern across postbacks but in this case the filter action has not been invoked yet.

How can I preserve the text across timer ticks till the user invokes a filter action using the context menu?

Thanks
Sebastian
Telerik team
 answered on 25 Feb 2009
1 answer
137 views
hi. going through the white papers trying to figure out how to get my grid to load as edit mode, allow me update several rows, and then select one button to update them all. I went through a combination of Batch update, but that one is silly as it still wants you to select the rows you want to edit, (http://www.telerik.com/help/aspnet-ajax/grdperformingbatchupdates.html) and  default edti mode on load (http://www.telerik.com/help/aspnet/grid/grddefaulteditmodeforgriditemsoninitialload.html) which is close but still wants you to click update on every row. I managed to get the grid to load into edit mode when paging but cannot get the itemcommand to recognize new data after the first page. The first page updates exactly as expected. My requirements are to stay load into and stay in edit mode, page through items and update on other pages all with the same single button.
Code  and Souce
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)  
        If (e.CommandName = "UpdateAll") Then  
            For Each editedItem As GridEditableItem In RadGrid1.EditItems  
                Dim newValues As Hashtable = New Hashtable  
                'The GridTableView will fill the values from all editable columns in the hash  
                e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)  
                If newValues("Balance") IsNot Nothing Then  'WITHOUT THIS THE WHERE CLAUSE FAILS EACH TIME ON NEW PAGES.
                    SqlDataSource1.UpdateCommand = String.Format("Update Account SET Balance= {0} WHERE ID= {1} ", newValues("Balance"), editedItem.GetDataKeyValue("ID").ToString())  
                    SqlDataSource1.Update()  
                End If  
                editedItem.Edit = True 
            Next  
        End If  
 
        multiEdit()  
        RadGrid1.Rebind()  
    End Sub  
      
    Protected Sub RadGrid1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.DataBound  
        If IsPostBack Then  
            multiEdit()  
        End If  
    End Sub  
      
    Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRender  
        If Not IsPostBack Then  
            multiEdit()  
            RadGrid1.Rebind()  
        End If  
 
    End Sub  
 
    Sub multiEdit()  
 
        For Each item As GridItem In RadGrid1.MasterTableView.Items  
            If TypeOf item Is GridEditableItem Then  
                Dim editableItem As GridEditableItem = CType(item, GridDataItem)  
                editableItem.Edit = True 
            End If  
        Next  
 
    End Sub 

Source
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server"   
ConnectionString="<%$ ConnectionStrings:PHCJobPostsConn %>"   
SelectCommand="SELECT * FROM [Account]"   
</asp:SqlDataSource> 
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowEdit="True" DataSourceID="SqlDataSource1" 
               OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound">  
               <MasterTableView   DataKeyNames="ID" AutoGenerateColumns="false" EditMode="InPlace" 
                   CommandItemDisplay="TopAndBottom">  
                <Columns> 
              
                    <telerik:GridBoundColumn ReadOnly="true" DataField="ID" DataType="System.Int32" HeaderText="ID"  SortExpression="ID" UniqueName="ID">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn ReadOnly="true" DataField="Name" HeaderText="Name" SortExpression="Name" UniqueName="Name">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn ReadOnly="true" DataField="AccountNo" HeaderText="AccountNo" SortExpression="AccountNo" UniqueName="AccountNo">  
            </telerik:GridBoundColumn> 
                <telerik:GridTemplateColumn> 
            <ItemTemplate> 
            <%#Eval("Balance")%> 
            </ItemTemplate> 
            <EditItemTemplate> 
            <asp:TextBox CssClass="none" ID="BalanceTB" Text='<%#Bind("Balance") %>' runat="server" /> 
            </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
          
            <telerik:GridBoundColumn ReadOnly="true" DataField="InsertDate" DataType="System.DateTime" HeaderText="InsertDate" SortExpression="InsertDate" UniqueName="InsertDate">  
            </telerik:GridBoundColumn> 
              
    </Columns> 
 <CommandItemTemplate> 
    <asp:Button runat="server" ID="UpdateAll" Text="Update All" CommandName="UpdateAll" /> 
</CommandItemTemplate> 
               </MasterTableView> 
</telerik:RadGrid> 


Yavor
Telerik team
 answered on 25 Feb 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?