Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
129 views

When I update an item in RadGrid, it updates my datasource but doesn't switch back to normal mode. The item still shows in edit mode. Here is what I have.

<telerik:RadGrid ID="RadGrid1" ShowStatusBar="true" GridLines="None" runat="server" AllowAutomaticDeletes="True" 
        AllowAutomaticInserts="True" OnNeedDataSource="RadGrid1_NeedDataSource" PageSize="5" 
        AllowAutomaticUpdates="True" AllowPaging="True" MasterTableView-AllowAutomaticInserts="true" 
        AutoGenerateColumns="True" AutoGenerateDeleteColumn="true" AutoGenerateEditColumn="true"   
        OnInsertCommand="RadGrid1_InsertCommand" OnUpdateCommand="RadGrid1_UpdateCommand" 
         Skin="Web20" OnDeleteCommand="RadGrid1_DeleteCommand" OnColumnCreated="RadGrid1_ColumnCreated">  
        <PagerStyle Mode="NextPrevAndNumeric" /> 
        <MasterTableView CommandItemDisplay="Top" Width="90%" DataKeyNames="id" > 
            <Columns> 
            </Columns> 
        </MasterTableView>   
    </telerik:RadGrid> 
 
 
protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)  
    {  
        GridDataItem gridEditFormItem = (GridDataItem)e.Item;  
        Hashtable ht = new Hashtable();  
        gridEditFormItem.ExtractValues(ht);  
        String ID = string.Empty;  
        foreach (DictionaryEntry entry in ht)  
        {  
            if (entry.Key.Equals("id"))  
            {  
                ID = entry.Value.ToString();  
                break;  
            }  
        }  
        DataTable myTable = (DataTable)this.Session["myDatatable"];  
        DataRow[] rowList = myTable.Select("id = '" + ID.ToString() + "'");  
        foreach (DataRow dr in rowList)  
        {  
            foreach (DictionaryEntry entry in ht)  
            {  
                if (!entry.Key.Equals("id"))  
                    dr[entry.Key.ToString()] = entry.Value;  
            }  
        }  
        Session["myDatatable"] = myTable;  
        RadGrid1.Rebind();  
    } 
Princy
Top achievements
Rank 2
 answered on 04 May 2009
1 answer
119 views
Searching thru docs and forums to get an overview.. and I'm still a bit unclear how to do this:

What would be the overview/how-to filter columns... from asp/rad controls, not-in the column filtering template, but elsewhere on the page?.. 
while, satisfying the following:

- object datasource
- grid columns may or may not be auto-generated, or mix of both.  Columns may be added declarative, added/removed programmatically,  etc
- Header, Filtering Item.. NOT visible. 
- May be a cardview or datalist style 

Any pointers would be appreciated!
David
Shinu
Top achievements
Rank 2
 answered on 04 May 2009
1 answer
108 views
Is it possible to drag a treeview node from one treeview control to ANOTHER treeview control?

Thanks,
Marty
Shinu
Top achievements
Rank 2
 answered on 04 May 2009
1 answer
82 views
Hey all.

Is there a way i can force the grid to scroll to a specific row in javascript?

here's my thing:
each grid row will show an input text box to the user if the row is selected. If the user clicks submit, i show a label that indicates a required field if the input is empty.
if the row is hidden due to scrolling, i'd like to be able to scroll to the first text box row that violates a required field condition. thanks.
Shinu
Top achievements
Rank 2
 answered on 04 May 2009
1 answer
195 views
I was wondering if it was possible to do the following:

GridView is loaded and data is populated.  Lets say there are 2 columns, firstname and lastname.   The user wants to change the lastname of one of the records.  They click the ACTUAL lastname cell of the record they want to change and the label changes to a textbox (or listbox, etc...) but ONLY for that cell.  The firstname remains a label and un-editable.

I've actually seen this ONCE in a web application service we purchased (hosted by service provider, dont' have access to source code).  I love this funtionality and would love to do it.  I've looked through the grid demos but was unable to find anything related.   Here is a screenshot of said web application to help you visualize the concept.  http://i5.photobucket.com/albums/y176/drpcken/3.jpg

Thanks!
Princy
Top achievements
Rank 2
 answered on 04 May 2009
1 answer
124 views
I have a telerik radgrid. My functionality is select a row on rowclick. I also want to deselect the row on row click if it is already selected.
I also want to change colors for RowSelected and Unselected.

I am trapping the row like this.

function

 

RowSelected(sender, eventArgs) {

 

 

var grid = sender;

 

 

}

 


Since I have a function like this, this overrides my RowUnselected() function of RowClick?

How can I go about doing that?

Regards        
Princy
Top achievements
Rank 2
 answered on 04 May 2009
1 answer
102 views
Hi,

I want to change the color of the cell whenever the value is changing in the cell.

Example:

if row(n)cell(n) value > 90
cell color = red
else if row(n)cell(n) >60 and <90
cell color=blue
else
cell color=gray
end if

Thanks.

Regards
Arshad
Shinu
Top achievements
Rank 2
 answered on 04 May 2009
1 answer
135 views
Hi,
I have a scheduler created with resource grouping (GroupBy = "Room"). I can get the appointment to show up just fine.
I am able to change the background color for each timeslot by setting the CssClass in 

RadScheduler1_TimeSlotCreated event.

Sub RadScheduler1_TimeSlotCreated(ByVal sender As Object, ByVal e As TimeSlotCreatedEventArgs)

        e.TimeSlot.CssClass = "colorStyle1"
End Sub

However, i would like to set different background color for each group of the Room.
For example:
Room1: Background color = Green
Room2: Background color = Red

Is there anyway i am able to acheive this??
Your kind help is very much appreciated.

Thanks.
Lim

Lim
Top achievements
Rank 1
 answered on 04 May 2009
0 answers
97 views
Hi,

I would like to share my code snippet inspired by this forum  post  . Apparently this is applied only for ASP.NET type of RadComboBox and not ASP.NET Ajax type of RadComboBox

  // currently my RadComboBox client-id name is ddlTopic. 
  // please substitute your proper combobox name appended by "_Arrow" 
  Link radComboBoxDropDownImage = ie.Link(Find.ById("ddlTopic_Arrow")); 
  radComboBoxDropDownImage.Click(); 
 
  // my RadComboBox client-id name is ddlTopic 
  // please substitute with your proper combobox name appended by "_DropDown" 
  Div divTopic = ie.Div(Find.ById("ddlTopic_DropDown")); 
 
  ElementCollection elColl = divTopic.ElementsWithTag("li"); 
 
  // here i would like to select the 4th option inside the combo-box 
  // the dropdownlist option index is started with 0  
  elColl[3].FireEvent("onmouseover"); 
  elColl[3].Click(); 

Regards,
hadi teo
Hadi Teo
Top achievements
Rank 1
 asked on 03 May 2009
3 answers
114 views
Hi All,

I'm editng a grid inline using the ExtractValuesFromItem method as described in your documentation. However, when the update has finished the grid remains in edit mode. How can I end the edit mode in this instance? Here is my code:

protected void radgridNetCosts_UpdateCommand(object source, GridCommandEventArgs e)
    {
        GridEditableItem item = (GridEditableItem)e.Item;
        int bookingTransactionID = int.Parse(item["BookingTransactionID"].Text);
        Dictionary<string, string> dictionary = new Dictionary<string, string>();
        
        radgridNetCosts.MasterTableView.ExtractValuesFromItem(dictionary, item);
        UpdatedSupplierCostsItem(radgridNetCosts, dictionary["SupplierReference"], bookingTransactionID);
    }

    private void UpdatedSupplierCostsItem(RadGrid radGrid, string supplierReference, int bookingTransactionID)
    {
        // connection string
        string cs = ConfigurationManager.ConnectionStrings["mcsQCConnectionString"].ConnectionString;
        SqlConnection conn = new SqlConnection(cs);

        // SQL Command
        SqlCommand command = new SqlCommand("UpdateSupplierCostsItem", conn);
        // Specify Command Type
        command.CommandType = CommandType.StoredProcedure;

        //Setup and assign parameters if needed
        command.Parameters.Add("@SupplierReference", SqlDbType.VarChar, 50).Value = supplierReference;
        command.Parameters.Add("@BookingTransactionID", SqlDbType.Int).Value = bookingTransactionID;

        try
        {
            conn.Open();
            command.ExecuteNonQuery();
        }

        catch (Exception ex)
        {
            // handle exception
        }
        finally
        {
            if (conn.State != null)
            {
                conn.Close();
            }
        }
    }

Thanks!
ibrahim
Top achievements
Rank 1
 answered on 03 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?