How to set different columns for rows in android gridview

I have something similar and i solved with the new RecyclerView. I created a Fragment with an a RecyclerView. RecyclerView on xml: <android.support.v7.widget.RecyclerView xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:id=”@+id/filter_subtypes” android:layout_width=”match_parent” android:layout_height=”match_parent” /> On your Fragment/Activity (OnViewCreated in my fragment case). I find the RecyclerView and set an Adapter- a normal Adapter class inherit from RecyclerView.Adapter< YOUR VIEW HOLDER … Read more

Full postback triggered by LinkButton inside GridView inside UpdatePanel

You need to register each and every LinkButton as an AsyncPostBackTrigger. After each row is bound in your GridView, you’ll need to search for the LinkButton and register it through code-behind as follows: protected void OrderGrid_RowDataBound(object sender, GridViewRowEventArgs e) { LinkButton lb = e.Row.FindControl(“MarkAsCompleteButton”) as LinkButton; ScriptManager.GetCurrent(this).RegisterAsyncPostBackControl(lb); } This also requires that ClientIDMode=”AutoID” be set … Read more

How to set Custom height for Widget in GridView in Flutter?

The key is the childAspectRatio. This value is use to determine the layout in GridView. In order to get the desired aspect you have to set it to the (itemWidth / itemHeight). The solution would be this: class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => … Read more

Reset scroll position after Async postback – ASP.NET

As you’re using UpdatePanels you’re going to need to hook into the ASP.NET AJAX PageRequestManager You’ll need to add a method to the endRequest event hooks that are: Raised after an asynchronous postback is finished and control has been returned to the browser. So you’d have something like: <script type=”text/javascript”> Sys.WebForms.PageRequestManager.getInstance().add_endRequest(pageLoaded); function pageLoaded(sender, args) { … Read more

Export GridView to multiple Excel sheet

Doing this with EPPlus is a piece of cake. No Interop assemblies required and literally 2 lines of code do all the magic: ws.Cells[“A1”].LoadFromDataTable(dt1, true); ws2.Cells[“A1”].LoadFromDataTable(dt2, true); Complete code: protected void ExportExcel_Click(object sender, EventArgs e) { //LinQ Query for dt2 var query = (from c in dt.AsEnumerable() select new {id= c.Field<string>(“id”),name=c.Field<string>(“name”),city=c.Field<string>(“city”)}) ; DataTable dt2 = … Read more

how to bind a dropdownlist in gridview?

If you are using template column then you can bind your drop-down from mark-up using data-binding expressions. For example, <asp:TemplateField HeaderText=”XYZ”> <ItemTemplate> <asp:DropDownList runat=”server” ID=”MyDD” DataSourceId=”MyDataSource” /> </ItemTemplate> </asp:TemplateField> Above is assuming that your drop-down data in constant across rows. If it is changing then you can use data-binding expression such as <asp:DropDownList runat=”server” DataSource=”<%# … Read more

Android gridview keep item selected

I think a better approach is to tell the GridView that you wish to support selecting (checking) the items: gridView.setChoiceMode(GridView.CHOICE_MODE_MULTIPLE); and then make sure that items in GridView implement Checkable interface. That means that the items can be either Checkbox, ToggleButton and so on or you can add the Checkable support yourself – for example … Read more

How to hide columns in an ASP.NET GridView with auto-generated columns?

Try putting the e.Row.Cells[0].Visible = false; inside the RowCreated event of your grid. protected void bla_RowCreated(object sender, GridViewRowEventArgs e) { e.Row.Cells[0].Visible = false; // hides the first column } This way it auto-hides the whole column. You don’t have access to the generated columns through grid.Columns[i] in your gridview’s DataBound event.