gridview

Set Gridview DataNavigateUrlFormatString Dynamically inside User Control(ASCX)

旧街凉风 提交于 2019-12-12 13:32:31
问题 i have a issue that i dont know if it can be done. i have an in an aspx page , that loads dedpends on user activity a user control (ascx). the user control has a gridview which one of my columns are hyperlink. <asp:HyperLinkField DataNavigateUrlFormatString='<%page %>' DataTextField="ReqId" HeaderText="Request No." DataNavigateUrlFields="ReqId" /> i want that on click of that hyperlink , it will direct to the same page with parameters, but i cant do it right. for some reason so i tried this

ASP.NET Setting parameter for SqlDataSource programatically does not work for postback

烈酒焚心 提交于 2019-12-12 12:17:19
问题 I want to set a parameter for a SqlDataSource programmatically as described in Step 5 at http://www.asp.net/data-access/tutorials/using-parameterized-queries-with-the-sqldatasource-vb . Also a GridView is bound to the sqlDataSource. My markup is: <asp:SqlDataSource ID="mySqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringHTL %>" SelectCommand="SELECT [subscription_con] FROM [HTL_CONSUME_CON] WHERE ([subscription_con] = @subscription_con)"> <SelectParameters>

Adding second class to gridview row in RowDataBound

淺唱寂寞╮ 提交于 2019-12-12 11:59:18
问题 I wish to add an additional class to a GridView programatically. I know I can do this using the following code: public void RowDataBound(object sender, GridViewRowEventArgs e) { DataRow row = ((DataRowView)e.Row.DataItem).Row; if (!row.Field<Boolean>("IsActive")) { e.Row.Attributes["class"] += "InActive"; } } and it works fine. The class "IsActive" is added, however, on alternating rows I end up with this HTML: <tr class="gvAlternatingStyle" class="InActive" onmouseover="gvMouseOver(this)"

How to Change Default Font Size in iTextSharp After Exporting GridView to PDF?

左心房为你撑大大i 提交于 2019-12-12 11:13:46
问题 I am using the iTextSharp method in the following link to export a GridView to a PDF document: http://www.aspsnippets.com/Articles/Export-GridView-To-Word-Excel-PDF-CSV-Formats-in-ASP.Net.aspx The code is like this: protected void btnExportPDF_Click(object sender, EventArgs e) { Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new

Getting ID of record just inserted?

自古美人都是妖i 提交于 2019-12-12 10:55:25
问题 I am processing items users have selected from a gridview, and performing an email and database insert operation. When the user selects a button, the code below takes information from the gridview, creates a new order in the Order table, and creates new entries in the Transactions table. How can I get the last inserted ID if I use this method of inserting a record? Would you recommend a different approach to this simple problem? protected void btnOrder_Click(object sender, EventArgs e) {

VB.net Mouse click single cell of gridview, change backcolor and output cell position (col and row) to textbox

别说谁变了你拦得住时间么 提交于 2019-12-12 10:24:30
问题 I have a gridview in a webform and I would like to know how I can select a single cell anywhere in that gridview using a mouse click. The selected cell's background colour then changes to a specific colour and a textbox on the form displays the row number and column number which I will pass as parameters to a stored procedure. When a subsequent cell is selected the last selected cell reverts back to it's original colour and the new cell's background colour is changed and the textbox updates

Implementing Picasso library on Custom grid view

Deadly 提交于 2019-12-12 10:24:22
问题 I have fragments with grid view and I want to keep my images in the application. But the performance is bad and slow. And I heard that Picasso library can increase the performance a lot. I tried to download the Picasso_sample folder and run it in my eclipse, where each time I add Picasso.jar file to my project, my project crashes and displays several errors. I tried to clean it and build it again, but in vain. Can anyone help me in suggesting a way to add Picasso library to my project? Here

how to eliminate another actionColumn in yii2?

人盡茶涼 提交于 2019-12-12 10:20:54
问题 I'm new to yii2,i want to make view for student data,in this picture i want to eliminate delete and edit icon,how can i eliminate this icon?This is my web view This is my source code for this index view GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], 'nis', 'nama_siswa', 'jenis_kelamin', 'telp', [ ...], ['class' => 'yii\grid\ActionColumn'], ], ]); ?> 回答1: use template property of ActionColumn as <?=

Call .NET method asynchronously and bind to grid upon completion

。_饼干妹妹 提交于 2019-12-12 09:57:03
问题 Container.RetrieveItems() calls a service which takes a while so I would like to call it asynchronously (after the items are retrieved they are set to the List property of the Container class). Upon completion of retrieving the items, I would like it to update a gridView which is inside an updatePanel (updatePanel Mode="Conditional" and ScriptManager EnablePartialRendering="true". UpdatePanel has no trigger items). I have set breakpoints and stepped through each step. The items are retrieved,

How to prevent OnItemClickListener work when long click performed?

一个人想着一个人 提交于 2019-12-12 09:33:53
问题 I have a gridview and i want its items to act different if user performs click or long click that is why i am using OnItemClickListener and OnItemLongClickListener but when long click happens both listeners react.I want to perform only OnItemLongClickListener. 回答1: public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { return true; } return true will be prevent click event to be continue. It will be perform only OnItemLongClickListener . 回答2: You can use