Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends.. Can any one explain me what is the use of "InsertVisible" property of BoundField in a GridView and at what conditions we should use it. I had seen the description in msdn.com but iam not able to understand exactly.
Thanks in advance..
Posted
Comments
Sergey Alexandrovich Kryukov 28-Dec-11 18:15pm    
Do you mean this:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datacontrolfield.insertvisible.aspx
?

And what exactly can't you understand? The documentation is crystal clear...
--SA
Venkat_C6 29-Dec-11 1:19am    
Ya I had seen that page. But I can't understand exact use.

1 solution

InsertVisible: If the value of this property is set to 'False' then one cannot set the value for the related column in 'Insert' mode. Thus, this property/feature is generally used when one wants to set a value of the column programmatically or may be default value defined in a database.

Just in case, here is the MSDN link[^] that sounds like you already went through.
 
Share this answer
 
Comments
Venkat_C6 29-Dec-11 1:31am    
Ok thank you for your answer. And one small doubt for me. I think If we give "ReadOnly=true" also we can get the same behaviour. Then what is the specific use of this.
Sandeep Mewara 29-Dec-11 1:36am    
Ok. :)
Why not you try a quick sample of your own and see the difference, as now you know their use!
Venkat_C6 29-Dec-11 1:41am    
Ya I had already tried. I had taken one grid view and gave insert option for it. First I gave ReadOnly="true" for the primary key column. And later I gave InsertVisible="false". I din't observer any change in it. I got same behaviour..
Sandeep Mewara 29-Dec-11 1:51am    
It's not just the view, it's about the scenario you are in. Even though appearance wise they look same but design/code wise they are different and will be used differently as and when required.
Venkat_C6 29-Dec-11 1:54am    
Ok thank u. When we use InsertItemTemplate & EditItemTemplate we will know the difference itseems. Once I will try like that. Im very much thankful to u for your response.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900