|
It can be achieved by setting the overflow style to scroll of the div tag.
<div style="overflow:scroll;width:40%;height:40%">
e.g.
The grid view in the .aspx is like this
<div style="overflow:scroll;width:30%;">
<asp:GridView ID="gvDetail" runat="server" AutoGenerateColumns="False"
HeaderStyle-BackColor="gray" AlternatingRowStyle-BackColor="GreenYellow "
BackColor="white" BorderColor="blue" BorderStyle="None" Width="80%">
<Columns>
<asp:BoundField DataField="UserId" HeaderText="User Id">
<ItemStyle HorizontalAlign="Left" Width="80%" />
</asp:BoundField>
<asp:BoundField DataField="Name" HeaderText="User Name">
<ItemStyle HorizontalAlign="Left" Width="80%" />
</asp:BoundField>
<asp:BoundField DataField="Age" HeaderText="User Age">
<ItemStyle HorizontalAlign="Left" Width="40%" />
</asp:BoundField>
<asp:BoundField DataField="Address" HeaderText="User Address">
<HeaderStyle Wrap="true"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" Width="10%" Wrap="true" />
</asp:BoundField>
<asp:BoundField DataField="Sex" HeaderText="User Sex">
<ItemStyle HorizontalAlign="Left" Width="10%" />
</asp:BoundField>
<asp:BoundField DataField="DOB" HeaderText="User DOB">
<ItemStyle HorizontalAlign="Left" Width="10%" />
</asp:BoundField>
<asp:BoundField DataField="Year" HeaderText="User Year">
<ItemStyle HorizontalAlign="Left" Width="10%" />
</asp:BoundField>
</Columns>
</asp:GridView>
</div>
I have used a datatable as the grid source and bind to the grid in the Page_Load event
DataTable dtSource = new DataTable();
#region Data Table Creation
dtSource.Columns.Add("UserId");
dtSource.Columns.Add("Name");
dtSource.Columns.Add("Age");
dtSource.Columns.Add("Address");
dtSource.Columns.Add("Sex");
dtSource.Columns.Add("DOB");
dtSource.Columns.Add("Year");
#endregion
#region Add Rows
dtSource.Rows.Add("1", "nil1", "23", "aaaayyyyy", "male", "29/12/3456", "2345");
dtSource.Rows.Add("2", "nil2", "23", "aaaa", "male", "29/12/3456", "2345");
dtSource.Rows.Add("3", "nil3", "23", "aaaa", "male", "29/12/3456", "2345");
dtSource.Rows.Add("4", "nil4", "23", "aaaa", "male", "29/12/3456", "2345");
dtSource.Rows.Add("5", "nil5", "23", "aaaa9999", "male", "29/12/3456", "2345");
dtSource.Rows.Add("6", "nil6", "23", "aaaa", "male", "29/12/3456", "2345");
dtSource.Rows.Add("7", "nil7", "23", "aaaa", "male", "29/12/3456", "2345");
dtSource.Rows.Add("8", "nil8", "23", "aaaa", "male", "29/12/3456", "2345");
dtSource.Rows.Add("9", "nil9", "23", "aaaa", "male", "29/12/3456", "2345");
dtSource.Rows.Add("10", "nil10", "23", "aaaa", "male", "29/12/3456", "2345");
#endregion
gvDetail.DataSource = dtSource;
gvDetail.DataBind();
Hope this helps
Niladri Biswas
|
|
|
|
|
This is not the ASP.NET forum.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
|
Hi
I have the code below wich copies a database to the same server with a different name, but the Database Diagram isn't copied. I need it because of the relationship between tables, primary keys,
foreign keys, delete rules and update rules as cascade. I have googled but
haven't found anything that works. I found this code, 'insert into
B.dbo.sysdiagrams select [name], principal_id, version,definition from
A.dbo.sysdiagrams', but the sysdiagrams isn't copied to the database when
I'm running the code below. And before when I ran the code below I didn't
get any errors, but now I get the error errorCode=-1073548784. Although the
error the database is created but without the Database Diagram, the
sysdiagram. If anybody have a solution to this problem, please help me. I'm
using SQL Server 2008.
Transfer transfer = new Transfer(server.Databases["Questions"]);
transfer.CopyAllObjects = true;
transfer.CopyAllUsers = true;
transfer.CopyAllTables = true;
transfer.Options.WithDependencies = true;
transfer.Options.NoIdentities = false;
transfer.DestinationDatabase = newdb.Name;
transfer.DestinationServer = server.Name;
transfer.DestinationLoginSecure = true;
transfer.CopySchema = true;
transfer.CopyData = true;
transfer.Options.DriAllKeys = true;
transfer.CopyAllStoredProcedures = true;
transfer.Options.ContinueScriptingOnError = true;
transfer.TransferData();
Fia
|
|
|
|
|
I am wondering is it possbile to use a VB based control in C# in Visual Studio?
if so, is there any difference between c# based control in C#?
thanks
|
|
|
|
|
1. yes
2. no
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Just to expand on the previous poster's points:
All .Net Framework base languages are compiled down to a bytecode concoction known as MSIL or CIL
MSIL: Microsoft Intermediate Language
CIL: Common Intermediate Language
MSIL was what CIL was called back when the .Net Framework was in Beta
A VB.Net based control is converted to code behind the scenes by the IDE (Visual Studio or SharpDevelop, etc.) This code is then converted to CIL at compile time and interpreted by the .Net Framework's JIT (Just In Time) compiler into actual processor code at runtime. This means that languages using the .Net Framework are known as interpreted languages (which means they use a bytecode which is converted to processor code at runtime), as opposed to compiled languages (which produce processor code from the first base) like C++. This is why C++ and ASM is usually faster than C# and VB.Net
Anyway, the upshot of this commonly-compiled basecode is that the same code will compile down to the same bytecode, regardless of which language you write it in. This makes up half of a .Net Framework executable (assembly). Logically then, the metadata (the other half of an assembly) would also be the same. Therefore, we can say that if an algorithm is implemented identically in two .Net Framework languages, they will produce an identical output. So if you can add a reference to and use a VB-based control, you can also add a reference to and use a C#-based control. To all intents and purposes, they are identical
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
thank you for your detailed exaplaination.
Can I understand that .net languages (VB,c# and c++) are actually the combination of compilation and interpretation languages. because they are neither same as conventional pure complied language nor the pure interpretated languages. But it seems that c# is said always as complied language, does this mean that c# itself belong to compilation language but when it is used in .net framwork, it contains one part of interpretation process. or my understanding is wrong?
thanks again.
|
|
|
|
|
All languages that target the .NET CLR are compiled. There is no interpretative portion.
|
|
|
|
|
Odd; I remembered reading somewhere that the languages are interpreted. Are they compiled to bytecode and then JIT-interpreted into machine code at runtime by the framework?
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
That's just a non-common way to say it. Usually they say JIT-compiled. Which is more like what it does, since it takes the MSIL and compiles it (but at runtime, hence the "JIT")
Unless you use NGEN of course, then it's just compiled (not at runtime).
But anyway, the language itself (the syntax) doesn't mandate anything. You could take C# source and compile it straight down to native code. Several compilers which do exactly that are already available, but you usually lose something - such as the ability to use reflection or interoperability with .NET assemblies.
And that goes the other way too, one could write an interpreter for it. That's mostly useless though, why would you want to execute the program slow on purpose? It would usually be faster to compile it on the fly..
|
|
|
|
|
thanks, but from previous answers, it seems to me there are interpretation parts.
I am still not very clear. It is necessary to clarify this conecpt.
|
|
|
|
|
MSIL is the virtual assembly code for the CLR. It's comparable to Java's intermediary code. Both are not usually used except when disassembling. Usually the binary form (aka byte code) is used, which is what goes inside the assemblies.
The JIT compiler then reads the byte code and turns it (with some very complicated steps) into native x86 (or x64 or even Itanium2) code, and then lets the CPU run that.
|
|
|
|
|
Glad to disappoint - there is no interpretation going on at all.
|
|
|
|
|
Seraph_summer wrote: t is necessary to clarify this conecpt.
Why is it ? .NEt works fine, if you understand it's inner workings or not,.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Seraph_summer wrote: hat .net languages (VB,c# and c++)
You might very well want to mention C++/CLI instead! The native (the original) C++ does not mix with any of these (has nothing to do with the .NET framework).
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I'm not sure in all of this if you got the full answer. Put your VB control in a dll, import the dll into your C# project, and it will work fine. You cannot mix languages in a single project.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Thanks for all the 1 votes to my posts in your thread. Good to see you finally;
1. Realized how screwed you are in programming
2. Admitted your malicious intent
3. Rised to the occasion to univote me.
4. Realized you can't trick people by reregistering your name
Looking forward to your future failures in the programming industry,
Eliott A.
|
|
|
|
|
“A true man hates no one.”
I know nothing , I know nothing ...
|
|
|
|
|
Perhaps mad, syphilitic Frenchmen aren't the best source of quotes?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
It's not about the source , it's about the effect !
P.S :
Find the source for this one
I know nothing , I know nothing ...
|
|
|
|
|
Stark DaFixzer wrote: It's not about the source , it's about the effect !
P.S :
Find the source for this one
It's you!! (Or at least Google thinks so...)
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Last time I checked Barcelona was in Spain, not France.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
modified on Thursday, June 4, 2009 5:23 PM
|
|
|
|
|
And Corsica is not near Barcelona...
http://www.napoleonguide.com/ajaccio.htm[^]
Would you accept "mad, syphilitic Frenchmen Corsican honorary French dicators"?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Corsica???[^]
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|