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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

disable foreign key link depending on column value in the current row using Attributes

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net

Hi ,

I want to disable  some foreign key links depending on column value in the current row

I am trying to have attribute like this :


 public partial class Order

        internal sealed class OrderMetadata
            public EntityCollection<Order_Detail> Order_Details { get; set; }

            public Nullable<DateTime> OrderDate { get; set; }



I had a look at Mr. Steve code for row highlighting , Conditional UIHint


View Complete Post

More Related Resource Links

Creating a custom column with a link to document (other than the name field) in document library



I have a document library with the standard name column linking to the document. However, we'd like to create a custom field and have that link to the document (and edit item menu).

How is this best accomplished?

Thanks in advance!


How do I modify the link of a Hyperlink column ?


OK , I'm a bit new to this game. I'm trying to build a web page that simply scans a directory in the server and creates a web page with links to the files in that directory - sounds simple and should be easy to do !

So I have a bit of code that reads the myDocuments folder in my web site and then populates a grid view hyperlink column with the filenames in the folder - wow it works !

The only thing I am struggling with now is getting the hyperlink correct within the GridView so that the user goes to the actual document.

So my code behind is;

Dim dirInfo As New System.IO.DirectoryInfo(Server.MapPath("~/MyDocuments"))  
       articleList.DataSource = dirInfo.GetFiles()  

which reads the file info in the directory myDocuments and binds the info to a datasource.

So now I'm using that datasource to display the filenames in a gridview so that the user can click on a name and open the file.

In export, i want to disable column in excel sheet

Hello, I am doing Import/Export. While export i want to disable some column in excel sheet, so during upload or import same primary key I can use, instead of user modify such column. Regards, Sandeep    

Need to link multiple External Content List items to a single document metadata column

I have an external content list - for my purposes, the data isn't any fancier than a list of terms provided by a web service (read only - I don't need update/delete functionality). I want to be able to link any subset of those terms to a single document metadata column (in other words, I need it to work like a normal content list that is defined to allow multiple values in a column) but SharePoint doesn't let me do that on an ECL. I need the content list to be externally driven since more values are going to be added to an outside system over time, but I think it's possible that I may not need a full-fledged ECL list to make this work this way in SharePoint. Just to clarify: I don't need the metadata values in my documents to maintain a PERSISTENT link to the web service (if someone changes an underlying value in the web service DB, it doesn't need to be updated in the document table too). I just want SharePoint to offer up an updated set of source values from the web service if somebody goes in and edits the document metadata. Any ideas for how I can make this work?

How to Change the Color of Link Label which is a Datagridview Column on a Row Selection?

Hi All I have a Link label as one of the column of Datagridview & also my SelectionBackColor set to Blue. Is there any way that i can change the link label color on a particular row selection as now my selectionbackcolor & link label color is matching...I am unable to the contents of that link label column. Should i do this on design level or in code level? Pls Help

Disable a link button in grid view after it is clicked

I have a grid view with each row as a link button. When I click on the row, some data parsing process takes place (about a 15 sec process). The grid refreshes itself at a regular interval. I want to disable the link when it is clicked once, so that the user gets to know that row has been processed already and does not click it again, until the grid refreshes itself and the row disappears. I am copying my gridview code below. Please give me some idea on how to disable the link button on that row as soon as it is clicked.Thank You. <td rowspan = "4" valign = "top" > <asp:Label ID="gvOrdersQueueLabel" runat="server" ></asp:Label><br /> <asp:UpdatePanel runat="server" ID="updatePane1"> <ContentTemplate> <asp:GridView ID="gvOrdersQueue" runat="server" OnRowCommand = "ParseOrderMessage" EmptyDataText="No Cases Found" BorderStyle = "Double" AlternatingRowStyle-BackColor="Beige" EnableViewState="false" AutoGenerateColumns="False" HeaderStyle-Height = "20" RowStyle-Height = "20" AllowPaging ="true" PageSize = "20" OnPageIndexChanging="gridView_PageIndexC

Adding a column from another List to a Dataview? Must I link sources or can I just add a new data so

Using Designer, I added a dataview to a webpart page and dragged in a single list source. It works as expected. I now want a column from another list in my view. Must I link in another datasource, or can i just insert the data source for the second list into my datasources? The new datasource is there in the code and I see the caml select for it. but my XSL still does not find data: <xsl:value-of select="/dsQueryResponse/Master/Rows/Row[@ID = current()/@Key]/@Lastname" /> I noticed my new columns are not in the <datafields> tag, I tried adding them but it did not help. If Master is my lookup list , @Key is the dataview I will match with and @ID is the column in Master, and @Lastname column I want to return, is the above syntax correct? Many Thanks.    

How can I switch the "Linked to document" link from the 'name' column to another column e.g. title

In SP2010 it is not possible to click on the icon to open a document in a list web part. Therefore I want to move the 'linked to document' feature from the name colum to the title column (as I do not show the name colum on the site). How can I do it or how can I make sure that clicking on the document icon leads me to the document and not to the edit menu?

How to link Title to it's associated page in list view without URL path column visible -bug?

I don't know if this is a bug or if I'm an idiot (or perhaps both, I'm open minded).   My site I'm developing is a site with publishing features activated where all my news stories are pages. What I want to have is a sortable list (the type hypothetically achieved using the XsltListView Web Part) the lists these pages with 3 columns visible: The Date created, the title (not the page name), and the author. The tricky part is that I would like the title, when clicked on, to take the person to the page. I'm actually almost there. I've created a new view with these specifications except for one issue. To make the title linked to the page, I have to have the column "URL Path" in my list view. When I remove this column, the titles instead all link to the root of the directory I'm in (ex: if I'm in Pages/Forms/My_List.aspx it will link to Pages/Forms/) Is this a bug, or is the URL Path required for the link to work? Is there a way to hide the column? Thanks.

How to convert the datagrid bound column item itself link to another detail page without using hyper

Dear experts, I would like to make the datagrid bound column to redirecting to the details page . For example , when my mouse over certain row of bound column in datagrid , it will change the colour to blue . Also , I can click anywhere of the row and the will redirect to the detail page . Can any expert help me on that ? Notes : I do not want to use hyperlink column and do not want to fix the text for every row. I want to use datafield, CommandName and CommandArguement. Thanks & Rgds

disable the sub/grand total column in calculated memebers


Is it possible to disable the sub/grand total column in calculated memebers programmatically. I don't want to display the sub/grand totals in pivot table? I know I can manually disable the sub/ grand totals in pivot table.



How to Disable Specific Column in Data Grid View and write something in Cell and load data in anothe


Hello All  ,

i have data grid view and i want to disable specific column from writing in it and in another column 

i want to write something like item code and load the item name automatically in the corresponding cell in the disabled column 

i hope that i write my problem correctly and you can understand what i want :)

thanks in advance ,

Kareem Naguib

Dropping a foreign key column in replication


I have set up transactional replication. I want to drop one column which acts as a foreign key in one of the tables in publisher. If I drop that column, will that drop be reflected in the subscriber??? BTW, can I drop that column without any issues?? If not, what are the steps to be followed for dropping that column?? Can some one please help me.....

multiple foreign keys to same table and same column


I am working with two Tables. Table A contains Id, Names. Table B  keeps only the reference to table A by InventoryID1, InventoryID12, InventoryID3.

Table A

Table B

I need a select statement to pull up all items from table B, showing the InventoryID 1, 2, 3 by their corresponding Name on Table A  

At first I thought this would be a simple inner join statement, which it does work when only InventoryID1 is involved
select * from Inventory
inner join Menu On (Inventory.InventoryId1 = Menu.Inventory)

The problem arises when I try to obtain the Inventory Name from Table A for the second or third (InventoryID2 or InventoryID3) from Table B. So basically, my problem is how to request a second or third Inventory.Name in the same select statement

Disable "Include Link" option in Report Subscription


Can the "include link" option be disabled?
So that when users are setting up subscription they do not see it or it is disabled.

Gridview column changing visibility depending on a row.text

        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 if (e.Row.Cells[1].Text == null)
                GridView1.Columns[1].Visible = false;


and im not getting the result i expected =\


ajaxtoolkit:CalendarExtender disable the dates which are lessthan current date


 hi frds

i'm using ajaxtoolkit:calenderextender

in this i should not be able to select dates which are lessthan currentdate

is this possible?

how to solve this ?

thank u in advance



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