.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Enabling individual items inside disabled listviewitems

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :WPF
 
I'm struggling with the following and would appreciate some help:

I have a number of items in a listview, some of which may be in a readonly state. When in readonly state, the items are disabled. However, I need the user to be able to remove them by clicking a button which is displayed using a celltemplate on a gridviewcolumn. By default this is disabled by default and setting IsEnabled="true" on the item itself does not enable it regardless of the state of the container.

I'd also like the user to be able to select the item to remove it in a multiselect mode. However selection is also disabled by default. What is the best way to achieve both ways of removing the item?

The item is disabled inside a user control using the following:

ListBoxItem listBoxItem = (Item is int) ? GetListBoxItemFromIndex((int)Item) : GetListBoxItemFromItem(Item);
if (listBoxItem != null)
{
 listBoxItem.IsEnabled = Enable;
}


The button is defined in XAML as follows. It is a


View Complete Post


More Related Resource Links

how to access items inside Sharepoint List Folder

  
hi all i have a list with structure as below  QuckList(List)                A(Folder)                       1(List Items)                       2(List Items)                B(Folder)                        1(List Items)   i have to display the List items inside the folder in drop down   i am able to access the folder as Splistitem, but not able to access the items inside the folder   any ideas how to access the items inside the List Folder   ragava_28

Order of the items in a DropDownList inside GridView

  

Hello,

I have a DropDownList inside the EditTemplateItem (if the user clicks edit) in a GridView. The DropDownList receives all available rows from the database.

My problem is, if the user clicks Edit in the GridView to edit a row and opens the DropDownList Box the original item is not selected but the first one. That means the items are sorted.

Have someone an idea how I can solve this issue that the right item / the original is selected if I change to edit mode of the grid view?

The only idear that I have is to write some lines in the code behind for the updating event and selected the suitable index manually but I think there must be an easier way.

Thanks!


.NET 4.0: Inside UserControl Menu.Items.Add(...) cause 'HttpException (0x80004005)'

  

When using .NET 4.0 there seems to be an issue - inside any UserControl Menu.Items.Add(...) cause 'HttpException (0x80004005)':

 

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:

[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
   System.Web.UI.ControlCollection.Add(Control child) +11242224
   System.Web.UI.Control.PreRenderRecursiveInternal() +113
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.Pre

WSS 3.0 - Access to individual items

  

Hi

We are using Windows SharePoint Services 3.0 and have set up a list for leave applications. We have an approval workflow in place and everything seems to be functioning correctly. My manager has now requested that we set up security so that people can only read the leave applications that they post and one or two additional users leave applications.

Due to sensitivity of leave, users should only their leave applications and one or two additional people whose leave that they would approve. Is anyone aware of a way to set this up?

Thanks very much
Tony


Enabling a RadioButtonList inside a multiview

  

Hi,

Initially I set a RadioButtonList to be disabled. Only when a linkbutton

link is clicked, I wanted to enable the radiobutton list. I tried the

javascript described in the code below. Nothing works.

Any help is appreciated.

By the way, why is asp multiview doesn't show up anything in firefox.

Thanks

Suresh 

This is what I see in viewsource

 <span disabled="disabled">
 <input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="Y"
 disabled="disabled" onclick="javascript:setTimeout('__doPostBack(\'RadioButtonList1$0\',\'\')', 0)" />
<label for="RadioButtonList1_0">Yes</label></span></td><td><span disabled="disabled">
<input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" value="N" disabled="disabled"
 onclick="javascript:setTimeout('__doPostBack(\'RadioButtonList1$1\',\'\')', 0)" />

wpf toolbar items disabled

  

hi

i am fresher to wpf development.

i added one toolbar to my wpf application.  then i selected tool bar from list of controls & added it to window.  then, when i try to add the item collection, a window pops up , with items, add button etc disabled. is there any setting to be done to enable the same?

regards

rajesh


Style changes to individual quick launch items

  
I have a quick launch bar on the left with headers that do NOT have URL's and subitems under those headers that are styled differently and that do have URL's (this is all out of the box, and works fine).  My issue is that I have one quick launch item that is a header and that does have a URL associated with it and although the hover style of this item is different than the other link-less headers, I would like to make this one header look different than the others to make it apparent that it's a link without having to hover over it.  Is it possible to do per-item style changes on the quick launch bar or something equivalent?  Thanks

How to see all items inside a menu

  
I have a specific problem that considers a menu which I am building inside a VS2005. I have too much menu items, so I can't see them all in Designer view. Can someone pleease tell me where I can set some sort of property so I can see them all. Or is there a way to engage arrows in menu that we can use to see all items. I did' not had this problem inside VS 2008 nor 2010. Thx

Toolbar Items Collection Editor: "Property editing not available" and Add disabled

  

I'm working on a WPF project in VS2010 and I am finding that the property editor is not behaving the way I expect (i.e. as it would for a WinForm app).

For example, I can manually edit the XAML to add items to a Toolbar, but if I open the Item Collection from the Properties window, I cannot make any changes. The Collection Editor says "Property editing not available."

If I manually add an Item, I can then edit its properties in the collection editor, but the Add option is still disabled. I could understand the first behavior since their weren't any items, but not the Add button being disabled (in both cases).

Thanks in advance.


- cawood

 blog |  twitter


Accessing the different controls inside a GridView control

  
how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

Enabling Users to Maintain SharePoint Content

  
When SharePoint is installed as a corporate intranet, there is a considerable amount of effort involved in maintaining the content to keep the site relevant. As we discussed in the first few parts of this series, SharePoint has many built-in features to reduce the burden on the site administrator.

Some areas of the site usually contain less-dynamic information. Internal memos and corporate policies are common examples of this information. One option for this information is to post these documents in a document library. Documents in a library are often stored in a few different formats: Word, Acrobat (PDF), or HTML. Each of these formats has its drawbacks.

Edit GridView Individual Cells in ASP.NET

  
The ASP.NET GridView allows for a row of data to be edited by setting the EditIndex property of the GridView, placing the entire row in edit mode.

You may not want the entire row in edit mode if you are using DropDownList controls for several columns in the EditItemTemplate. If each DropDownList has many options then loading them all at once may result in a sluggish page. Also, if your data structure is more like a 2 dimensional array rather than a set of rows, you may want to edit each cell individually.

Here I will demonstrate how to achieve this and also how to deal with event validation without disabling it.

jQuery: Styling DropDownList Alternating Items (Rows)

  
In the following example, I will show how you can style any asp:dropdownlist very easily.

The example demonstrates how you can change alternating row items background color, using the fadeTo() to add a nice touch in the dropdownlist. You can change alt rows with a couple lines.

Hide a repeater in ASP.NET C# if the DataSource contains no items?

  
I have an ASP.NET page that uses a repeater nested within another repeater to generate a listing of data. It's to the effect of the following:
In the (C#) code-behind I'm basically using LINQ to pull a listing of information from an XML document and bind that information to the first repeater.

Searching for the answer to this, it seems the method is to determine whether the data for the nested repeater is empty. If it is, then you set the visibility of the repeater to false.

How To Add calendar control inside a GridView

  
This article show hot to add calendar control inside a GridView with code in c#

Edit Individual GridView Cells in ASP.NET

  
The ASP.NET GridView allows for a row of data to be edited by setting the EditIndex property of the GridView, placing the entire row in edit mode.

You may not want the entire row in edit mode if you are using DropDownList controls for several columns in the EditItemTemplate. If each DropDownList has many options, then loading them all at once may result in a sluggish page. Also, if your data structure is more like a 2 dimensional array rather than a set of rows, you may want to edit each cell individually.

Using ATLAS PopUp Control with Calendar inside the GridView Control

  
In this video tutorial Mohammad demonstrates how you can access the Calendar control which is displayed using the ATLAS PopUp control inside the GridView control.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend